File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
packages/@vue/cli-service/lib/config Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,18 @@ module.exports = (api, options) => {
7272 // matter anyway
7373 chunksSortMode : 'none'
7474 } )
75+
76+ // keep chunk ids stable so async chunks have consistent hash (#1916)
77+ webpackConfig
78+ . plugin ( 'named-chunks' )
79+ . use ( require ( 'webpack/lib/NamedChunksPlugin' ) , [ chunk => {
80+ if ( chunk . name ) {
81+ return chunk . name
82+ }
83+ return `chunk-` + Array . from ( chunk . modulesIterable , m => {
84+ return m . id
85+ } ) . join ( '_' )
86+ } ] )
7587 }
7688
7789 // resolve HTML file(s)
Original file line number Diff line number Diff line change @@ -19,7 +19,9 @@ module.exports = (api, options) => {
1919 // keep module.id stable when vendor modules does not change
2020 webpackConfig
2121 . plugin ( 'hash-module-ids' )
22- . use ( require ( 'webpack/lib/HashedModuleIdsPlugin' ) )
22+ . use ( require ( 'webpack/lib/HashedModuleIdsPlugin' ) , [ {
23+ hashDigest : 'hex'
24+ } ] )
2325
2426 // disable optimization during tests to speed things up
2527 if ( process . env . VUE_CLI_TEST ) {
You can’t perform that action at this time.
0 commit comments