@@ -4,7 +4,10 @@ const Filter = require('broccoli-persistent-filter');
44const { JSDOM } = require ( 'jsdom' ) ;
55
66module . exports = class BasePageWriter extends Filter {
7- constructor ( inputNodes , { annotation, fastbootConfig, appName, manifest, outputPaths } ) {
7+ constructor (
8+ inputNodes ,
9+ { annotation, fastbootConfig, appName, manifest, outputPaths }
10+ ) {
811 super ( inputNodes , {
912 annotation,
1013 extensions : [ 'html' ] ,
@@ -20,7 +23,9 @@ module.exports = class BasePageWriter extends Filter {
2023 getDestFilePath ( ) {
2124 let filteredRelativePath = super . getDestFilePath ( ...arguments ) ;
2225
23- return filteredRelativePath === this . _manifest . htmlFile ? filteredRelativePath : null ;
26+ return filteredRelativePath === this . _manifest . htmlFile
27+ ? filteredRelativePath
28+ : null ;
2429 }
2530
2631 processString ( content ) {
@@ -49,7 +54,10 @@ module.exports = class BasePageWriter extends Filter {
4954 }
5055 let nodeRange = new NodeRange ( firstConfigMeta ) ;
5156 for ( let [ name , options ] of Object . entries ( this . _fastbootConfig ) ) {
52- nodeRange . insertJsonAsMetaTag ( `${ name } /config/fastboot-environment` , options ) ;
57+ nodeRange . insertJsonAsMetaTag (
58+ `${ name } /config/fastboot-environment` ,
59+ options
60+ ) ;
5361 }
5462 }
5563
@@ -61,7 +69,9 @@ module.exports = class BasePageWriter extends Filter {
6169 let fastbootScripts = this . _findFastbootScriptToInsert ( scriptTags ) ;
6270 let appJsTag = findAppJsTag ( scriptTags , this . _appJsPath , this . _rootURL ) ;
6371 if ( ! appJsTag ) {
64- throw new Error ( 'ember-cli-fastboot cannot find own app script tag' ) ;
72+ throw new Error (
73+ 'ember-cli-fastboot cannot find own app script tag, please check your html file'
74+ ) ;
6575 }
6676
6777 insertFastbootScriptsBeforeAppJsTags ( fastbootScripts , appJsTag ) ;
@@ -76,15 +86,17 @@ module.exports = class BasePageWriter extends Filter {
7686
7787 return this . _manifest . vendorFiles
7888 . concat ( this . _manifest . appFiles )
79- . map ( src => urlWithin ( src , rootURL ) )
80- . filter ( src => ! scriptSrcs . includes ( src ) ) ;
89+ . map ( ( src ) => urlWithin ( src , rootURL ) )
90+ . filter ( ( src ) => ! scriptSrcs . includes ( src ) ) ;
8191 }
8292
8393 _ignoreUnexpectedScripts ( scriptTags ) {
8494 let expectedFiles = this . _expectedFiles ;
8595 let rootURL = this . _rootURL ;
8696 for ( let element of scriptTags ) {
87- if ( ! expectedFiles . includes ( urlWithin ( element . getAttribute ( 'src' ) , rootURL ) ) ) {
97+ if (
98+ ! expectedFiles . includes ( urlWithin ( element . getAttribute ( 'src' ) , rootURL ) )
99+ ) {
88100 element . setAttribute ( 'data-fastboot-ignore' , '' ) ;
89101 }
90102 }
0 commit comments