fix(webpack): allow hmr client path to be set (#7318)

This commit is contained in:
Mathieu TUDISCO 2020-05-05 23:56:03 +02:00 committed by GitHub
parent 8c7228f1e8
commit 6040257ca3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -186,17 +186,18 @@ export default class WebpackClientConfig extends WebpackBaseConfig {
const { client = {} } = hotMiddleware || {}
const { ansiColors, overlayStyles, ...options } = client
const hotMiddlewareClientOptions = {
reload: true,
timeout: 30000,
ansiColors: JSON.stringify(ansiColors),
overlayStyles: JSON.stringify(overlayStyles),
path: `${router.base}/__webpack_hmr/${this.name}`.replace(/\/\//g, '/'),
...options,
name: this.name
}
const clientPath = `${router.base}/__webpack_hmr/${this.name}`
const hotMiddlewareClientOptionsStr =
`${querystring.stringify(hotMiddlewareClientOptions)}&path=${clientPath}`.replace(/\/\//g, '/')
const hotMiddlewareClientOptionsStr = querystring.stringify(hotMiddlewareClientOptions)
// Entry points
config.entry = Object.assign({}, config.entry, {