Skip to content

Commit 97288ad

Browse files
authored
fix: invalid chunkFileName (#214)
As per Webpack documentation, [runtime] can be used only for hotUpdateMainFilename and not hotUpdateChunkFilename ( https://webpack.js.org/configuration/output/#outputhotupdatechunkfilename ). By having this template string inside outputhotupdatechunkfilename , the HMR breaks
1 parent a31a96e commit 97288ad

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/plugins/hmr.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ const init = function init(compiler, log) {
2323
const webpackMajorVersion = getMajorVersion(version);
2424
// eslint-disable-next-line no-param-reassign
2525
compiler.options.output = Object.assign(compiler.options.output, {
26-
hotUpdateChunkFilename:
27-
webpackMajorVersion >= 5
28-
? `[runtime]-${compiler.wpsId}-[id]-wps-hmr.js`
29-
: `${compiler.wpsId}-[id]-wps-hmr.js`,
26+
hotUpdateChunkFilename: `${compiler.wpsId}-[id]-wps-hmr.js`,
3027
hotUpdateMainFilename:
3128
webpackMajorVersion >= 5
3229
? `[runtime]-${compiler.wpsId}-wps-hmr.json`

0 commit comments

Comments
 (0)