Skip to content

Commit

Permalink
fixup! fix: disable realContentHash optimization in app target
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Apr 14, 2021
1 parent 448ab96 commit 8a3dfa4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/@vue/cli-service/lib/config/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,15 @@ module.exports = (api, options) => {
.filename(outputFilename)
.chunkFilename(outputFilename)

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

// code splitting
if (process.env.NODE_ENV !== 'test') {
Expand Down

0 comments on commit 8a3dfa4

Please sign in to comment.