Skip to content

Commit 0909bc8

Browse files
committed
fix: revert file name hashing in dev mode
closes #2492 The change was intended to mitigate the problem that Safari keeps caching dev bundles. But it caused several unintended bugs: 1. [Hashes in file names with HMR enabled might cause memory leaks](webpack/webpack-dev-server#377 (comment)) 2. Moving the hash to file query also breaks many webpack loaders: 1. [mocha-webpack](f683583) 2. [django-webpack-loader](#2492)) So till we find a better way to solve this issue, hashes in dev bundles should be removed.
1 parent 69cec80 commit 0909bc8

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

packages/@vue/cli-plugin-unit-mocha/index.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ module.exports = api => {
1515
options.optimizeSSR = false
1616
return options
1717
})
18-
19-
const isLegacyBundle = process.env.VUE_CLI_MODERN_MODE && !process.env.VUE_CLI_MODERN_BUILD
20-
// mocha-webpack cannot deal with the query parameter in filename
21-
webpackConfig
22-
.output
23-
.filename(isLegacyBundle ? '[name]-legacy.js?' : '[name].js')
2418
}
2519
})
2620

packages/@vue/cli-service/lib/config/base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ module.exports = (api, options) => {
3333
.end()
3434
.output
3535
.path(api.resolve(options.outputDir))
36-
.filename(isLegacyBundle ? '[name]-legacy.js?[hash:8]' : '[name].js?[hash:8]')
36+
.filename(isLegacyBundle ? '[name]-legacy.js' : '[name].js')
3737
.publicPath(options.baseUrl)
3838

3939
webpackConfig.resolve

0 commit comments

Comments
 (0)