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 { client = {} } = hotMiddleware || {}
const { ansiColors, overlayStyles, ...options } = client const { ansiColors, overlayStyles, ...options } = client
const hotMiddlewareClientOptions = { const hotMiddlewareClientOptions = {
reload: true, reload: true,
timeout: 30000, timeout: 30000,
ansiColors: JSON.stringify(ansiColors), ansiColors: JSON.stringify(ansiColors),
overlayStyles: JSON.stringify(overlayStyles), overlayStyles: JSON.stringify(overlayStyles),
path: `${router.base}/__webpack_hmr/${this.name}`.replace(/\/\//g, '/'),
...options, ...options,
name: this.name name: this.name
} }
const clientPath = `${router.base}/__webpack_hmr/${this.name}`
const hotMiddlewareClientOptionsStr = const hotMiddlewareClientOptionsStr = querystring.stringify(hotMiddlewareClientOptions)
`${querystring.stringify(hotMiddlewareClientOptions)}&path=${clientPath}`.replace(/\/\//g, '/')
// Entry points // Entry points
config.entry = Object.assign({}, config.entry, { config.entry = Object.assign({}, config.entry, {