File tree 1 file changed +7
-4
lines changed 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -28,19 +28,22 @@ class ExtractHtmlManifestPlugin {
28
28
} ,
29
29
opts || { }
30
30
) ;
31
+ this . output = '{}' ;
31
32
}
32
33
33
34
apply ( compiler ) {
34
35
compiler . hooks . compilation . tap ( 'ExtractHtmlManifestPlugin' , compilation => {
35
36
this . htmlWebpackPlugin
36
37
. getHooks ( compilation )
37
38
. beforeAssetTagGeneration . tap ( 'ExtractHtmlManifestPlugin' , data => {
38
- var outputFolder = compiler . options . output . path ;
39
- var outputFile = path . resolve ( outputFolder , this . opts . fileName ) ;
40
- var output = this . opts . serialize ( data . assets ) ;
41
- fs . writeFileSync ( outputFile , output , 'utf8' ) ;
39
+ this . output = this . opts . serialize ( data . assets ) ;
42
40
} ) ;
43
41
} ) ;
42
+ compiler . hooks . afterEmit . tap ( 'ExtractHtmlManifestPlugin' , ( ) => {
43
+ var outputFolder = compiler . options . output . path ;
44
+ var outputFile = path . resolve ( outputFolder , this . opts . fileName ) ;
45
+ fs . writeFileSync ( outputFile , this . output , 'utf8' ) ;
46
+ } ) ;
44
47
}
45
48
}
46
49
You can’t perform that action at this time.
0 commit comments