File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "printWidth": 80,
3+ "semi": true,
4+ "trailingComma": "es5",
5+ "singleQuote": true,
6+ "jsxBracketSameLine": true,
7+ "proseWrap": true
8+ }
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class NetlifyServerPushPlugin {
1919 }
2020
2121 apply ( compiler ) {
22- compiler . plugin ( 'emit' , ( compilation , callback ) => {
22+ const handler = ( compilation , callback ) => {
2323 const routes = [ ] ;
2424 // Set default value as comment incase if this file is not present
2525 let mainJs = '# no js files' ;
@@ -76,7 +76,14 @@ class NetlifyServerPushPlugin {
7676 } ;
7777
7878 callback ( ) ;
79- } ) ;
79+ return compilation ;
80+ } ;
81+
82+ if ( compiler . hooks ) {
83+ compiler . hooks . emit . tapAsync ( 'NetlifyServerPushPlugin' , handler ) ;
84+ } else {
85+ compiler . plugin ( 'emit' , handler ) ;
86+ }
8087 }
8188}
8289
You can’t perform that action at this time.
0 commit comments