@@ -20,8 +20,6 @@ class NetlifyServerPushPlugin {
2020
2121 apply ( compiler ) {
2222 const handler = ( compilation , callback ) => {
23- const routes = [ ] ;
24- 2523 let manifest = compilation . assets [ 'push-manifest.json' ] ;
2624 if ( ! manifest ) {
2725 // on pre-render build this is not present and thus need an early exit
@@ -39,16 +37,16 @@ class NetlifyServerPushPlugin {
3937
4038 const redirects = `${ this . redirects . join ( '\n' ) } \n/* /index.html 200` ;
4139
42- for ( const route in manifest ) {
40+ for ( const route in manifest ) {
4341 const files = Object . keys ( manifest [ route ] ) ;
4442 let routePreloadText = `${ route } ` ;
4543 files . forEach ( file => {
4644 const details = manifest [ route ] [ file ] ;
47- routePreloadText += `\n\tLink: </${ file } >; rel=preload; as=${ details . type } `
48- if ( / ^ b u n d l e ( .+ ) \. e s m \. j s $ / . test ( filename ) ) {
45+ routePreloadText += `\n\tLink: </${ file } >; rel=preload; as=${ details . type } ` ;
46+ if ( / ^ b u n d l e ( .+ ) \. e s m \. j s $ / . test ( file ) ) {
4947 routePreloadText += '; crossorigin=anonymous' ;
5048 }
51- } )
49+ } ) ;
5250 headers = `${ headers } \n${ routePreloadText } ` ;
5351 }
5452
0 commit comments