Skip to content

Commit 8a3dfa4

Browse files
committed
fixup! fix: disable realContentHash optimization in app target
1 parent 448ab96 commit 8a3dfa4

File tree

1 file changed

+9
-2
lines changed
  • packages/@vue/cli-service/lib/config

1 file changed

+9
-2
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,15 @@ module.exports = (api, options) => {
3333
.filename(outputFilename)
3434
.chunkFilename(outputFilename)
3535

36-
webpackConfig.optimization
37-
.set('realContentHash', false)
36+
const webpack = require('webpack')
37+
const { semver } = require('@vue/cli-shared-utils')
38+
const webpackMajor = semver.major(webpack.version)
39+
if (webpackMajor !== 4) {
40+
// FIXME: a temporary workaround to get accurate contenthash in `applyLegacy`
41+
// Should use a better fix per discussions at <https://github.com/jantimon/html-webpack-plugin/issues/1554#issuecomment-753653580>
42+
webpackConfig.optimization
43+
.set('realContentHash', false)
44+
}
3845

3946
// code splitting
4047
if (process.env.NODE_ENV !== 'test') {

0 commit comments

Comments
 (0)