@@ -36,11 +36,11 @@ export function pitch(request) {
36
36
publicPath,
37
37
} ;
38
38
const childCompiler = this . _compilation . createChildCompiler ( `mini-css-extract-plugin ${ NS } ${ request } ` , outputOptions ) ;
39
- childCompiler . apply ( new NodeTemplatePlugin ( outputOptions ) ) ;
40
- childCompiler . apply ( new LibraryTemplatePlugin ( null , 'commonjs2' ) ) ;
41
- childCompiler . apply ( new NodeTargetPlugin ( ) ) ;
42
- childCompiler . apply ( new SingleEntryPlugin ( this . context , `!!${ request } ` , 'mini-css-extract-plugin' ) ) ;
43
- childCompiler . apply ( new LimitChunkCountPlugin ( { maxChunks : 1 } ) ) ;
39
+ new NodeTemplatePlugin ( outputOptions ) . apply ( childCompiler ) ;
40
+ new LibraryTemplatePlugin ( null , 'commonjs2' ) . apply ( childCompiler ) ;
41
+ new NodeTargetPlugin ( ) . apply ( childCompiler ) ;
42
+ new SingleEntryPlugin ( this . context , `!!${ request } ` , 'mini-css-extract-plugin' ) . apply ( childCompiler ) ;
43
+ new LimitChunkCountPlugin ( { maxChunks : 1 } ) . apply ( childCompiler ) ;
44
44
// We set loaderContext[NS] = false to indicate we already in
45
45
// a child compiler so we don't spawn another child compilers from there.
46
46
childCompiler . hooks . thisCompilation . tap ( 'mini-css-extract-plugin loader' , ( compilation ) => {
@@ -58,7 +58,7 @@ export function pitch(request) {
58
58
} ) ;
59
59
60
60
let source ;
61
- childCompiler . plugin ( 'after-compile ', ( compilation , callback ) => {
61
+ childCompiler . hooks . afterCompile . tap ( 'mini-css-extract-plugin ', ( compilation ) => {
62
62
source = compilation . assets [ childFilename ] && compilation . assets [ childFilename ] . source ( ) ;
63
63
64
64
// Remove all chunk assets
@@ -67,8 +67,6 @@ export function pitch(request) {
67
67
delete compilation . assets [ file ] ; // eslint-disable-line no-param-reassign
68
68
} ) ;
69
69
} ) ;
70
-
71
- callback ( ) ;
72
70
} ) ;
73
71
74
72
const callback = this . async ( ) ;
@@ -87,7 +85,8 @@ export function pitch(request) {
87
85
if ( ! source ) {
88
86
return callback ( new Error ( "Didn't get a result from child compiler" ) ) ;
89
87
}
90
- let text , locals ;
88
+ let text ;
89
+ let locals ;
91
90
try {
92
91
text = exec ( this , source , request ) ;
93
92
locals = text && text . locals ;
0 commit comments