File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -121,9 +121,14 @@ module.exports = class SpikeUtils {
121
121
} )
122
122
123
123
// first we remove the files from webpack's `assets`
124
- const filesDotJs = files . map ( ( f ) => `${ f } .js` )
125
- for ( const a in compilation . assets ) {
126
- if ( filesDotJs . indexOf ( a ) > - 1 ) { delete compilation . assets [ a ] }
124
+ const chunksByName = compilation . records . chunks . byName
125
+ const chunkNames = Object . keys ( compilation . assets )
126
+ for ( let k in chunksByName ) {
127
+ // if the chunk name is in our spike-processed files, we remove
128
+ // that chunk from the assets to be written
129
+ if ( files . indexOf ( k ) > - 1 ) {
130
+ delete compilation . assets [ chunkNames [ chunksByName [ k ] ] ]
131
+ }
127
132
}
128
133
129
134
// Now we remove any chunks that are not further processed.
You can’t perform that action at this time.
0 commit comments