File tree 1 file changed +8
-5
lines changed 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -187,17 +187,20 @@ export default class CSSSplitWebpackPlugin {
187
187
// Run on `emit` when user specifies the compiler phase
188
188
// Due to the incorrect css split + optimization behavior
189
189
// Expected: css split should happen after optimization
190
- compiler . plugin ( ' emit', ( compilation , done ) => {
190
+ compiler . hooks . emit . tapAsync ( 'css-split- emit', ( compilation , done ) => {
191
191
return this . chunksMapping ( compilation , compilation . chunks , done ) ;
192
192
} ) ;
193
193
} else {
194
194
// Only run on `this-compilation` to avoid injecting the plugin into
195
195
// sub-compilers as happens when using the `extract-text-webpack-plugin`.
196
- compiler . plugin ( 'this-compilation' , ( compilation ) => {
197
- compilation . plugin ( 'optimize-chunk-assets' , ( chunks , done ) => {
198
- return this . chunksMapping ( compilation , chunks , done ) ;
196
+ compiler . hooks . thisCompilation . tap ( 'css-split-this-compilation' ,
197
+ ( compilation ) => {
198
+ compilation . hooks . optimizeChunkAssets . tapAsync (
199
+ 'css-split-optimize-chunk-assets' ,
200
+ ( chunks , done ) => {
201
+ return this . chunksMapping ( compilation , chunks , done ) ;
202
+ } ) ;
199
203
} ) ;
200
- } ) ;
201
204
}
202
205
}
203
206
}
You can’t perform that action at this time.
0 commit comments