@@ -12,7 +12,7 @@ class NetlifyServerPushPlugin {
1212 this . redirects = redirects ;
1313 } else {
1414 throw new TypeError (
15- `redirects should be an array, but was of type '${ typeof redirects } '` ,
15+ `redirects should be an array, but was of type '${ typeof redirects } '`
1616 ) ;
1717 }
1818 }
@@ -52,9 +52,7 @@ class NetlifyServerPushPlugin {
5252 . replace ( / \. c h u n k ( \. \w + ) ? \. j s $ / , '' )
5353 . replace ( / \/ h o m e / , '/' ) ;
5454 const routeJs = `Link: </${ filename } >; rel=preload; as=script` ;
55- headers = `${ headers } \n${ path } \n\t${ mainCss } \n\t${ mainJs } \n\t${
56- routeJs
57- } `;
55+ headers = `${ headers } \n${ path } \n\t${ mainCss } \n\t${ mainJs } \n\t${ routeJs } ` ;
5856 } ) ;
5957
6058 compilation . assets . _headers = {
@@ -90,7 +88,7 @@ class NetlifyServerPushPlugin {
9088module . exports = function ( config , options = { } ) {
9189 if ( ! config || ! config . plugins ) {
9290 throw new Error (
93- 'You need to pass the webpack config to preact-cli-plugin-netlify!' ,
91+ 'You need to pass the webpack config to preact-cli-plugin-netlify!'
9492 ) ;
9593 }
9694
@@ -105,7 +103,7 @@ module.exports = function(config, options = {}) {
105103 }
106104
107105 config . plugins . push ( new NetlifyServerPushPlugin ( options ) ) ;
108- const plugins = config . plugins ;
106+ const { plugins } = config ;
109107 for ( let pluginIndex = 0 ; pluginIndex < plugins . length ; pluginIndex ++ ) {
110108 const plugin = plugins [ pluginIndex ] ;
111109 if ( plugin && plugin . options && plugin . options . cacheId ) {
@@ -123,7 +121,7 @@ module.exports = function(config, options = {}) {
123121
124122function getPluginsByName ( config , name ) {
125123 return getPlugins ( config ) . filter (
126- w => w . plugin && w . plugin . constructor && w . plugin . constructor . name === name ,
124+ w => w . plugin && w . plugin . constructor && w . plugin . constructor . name === name
127125 ) ;
128126}
129127
0 commit comments