File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed
packages/@vue/cli-service/lib/config Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -119,25 +119,15 @@ module.exports = (api, options) => {
119
119
} )
120
120
121
121
// keep chunk ids stable so async chunks have consistent hash (#1916)
122
- const seen = new Set ( )
123
- const nameLength = 4
124
122
webpackConfig
125
123
. plugin ( 'named-chunks' )
126
124
. use ( require ( 'webpack/lib/NamedChunksPlugin' ) , [ chunk => {
127
125
if ( chunk . name ) {
128
126
return chunk . name
129
127
}
130
- const modules = Array . from ( chunk . modulesIterable )
131
- if ( modules . length > 1 ) {
132
- const hash = require ( 'hash-sum' )
133
- const joinedHash = hash ( modules . map ( m => m . id ) . join ( '_' ) )
134
- let len = nameLength
135
- while ( seen . has ( joinedHash . substr ( 0 , len ) ) ) len ++
136
- seen . add ( joinedHash . substr ( 0 , len ) )
137
- return `chunk-${ joinedHash . substr ( 0 , len ) } `
138
- } else {
139
- return modules [ 0 ] . id
140
- }
128
+ return `chunk-` + Array . from ( chunk . modulesIterable , m => {
129
+ return m . id
130
+ } ) . join ( '_' )
141
131
} ] )
142
132
}
143
133
You can’t perform that action at this time.
0 commit comments