@@ -174,10 +174,13 @@ module.exports = class FastBootConfig extends Plugin {
174174 }
175175
176176 buildManifest ( ) {
177- let appFilePath = 'assets/' + path . basename ( this . outputPaths . app . js ) ;
178- let appFileName = appFilePath . split ( '.' ) [ 0 ] ;
179- let appFastbootFilePath = appFileName + '-fastboot.js' ;
180- let vendorFilePath = 'assets/' + path . basename ( this . outputPaths . vendor . js ) ;
177+ function stripLeadingSlash ( filePath ) {
178+ return filePath . replace ( / ^ \/ / , '' ) ;
179+ }
180+
181+ let appFilePath = stripLeadingSlash ( this . outputPaths . app . js ) ;
182+ let appFastbootFilePath = appFilePath . replace ( / \. j s $ / , '' ) + '-fastboot.js' ;
183+ let vendorFilePath = stripLeadingSlash ( this . outputPaths . vendor . js ) ;
181184
182185 let manifest = {
183186 appFiles : [ appFilePath , appFastbootFilePath ] ,
@@ -197,7 +200,6 @@ module.exports = class FastBootConfig extends Plugin {
197200 // update the app files array with fingerprinted files
198201 let rewrittenAppFiles = manifest [ 'appFiles' ] . map ( file => rewrittenAssets . assets [ file ] || file ) ;
199202 manifest [ 'appFiles' ] = rewrittenAppFiles ;
200-
201203 }
202204
203205 this . manifest = manifest ;
@@ -265,12 +267,3 @@ function getDependencyVersion(pkg, dep) {
265267
266268 return pkg . dependencies [ dep ] ;
267269}
268-
269- function assetToFastboot ( key ) {
270- let parts = key . split ( '/' ) ;
271- let dir = parts [ 0 ] ;
272- if ( dir === 'assets' ) {
273- parts [ 0 ] = 'fastboot' ;
274- }
275- return parts . join ( '/' ) ;
276- }
0 commit comments