@@ -38,12 +38,16 @@ export default (cwd: string, configuration: Configuration) => {
38
38
const content = readFileSync ( cwd + '/' + configuration . fileFinder . distJSRoot + '/' + file , 'utf8' , ) ;
39
39
const res = matcher . exec ( content ) ;
40
40
if ( res && res [ 1 ] ) {
41
- if ( typeof configuration . routes . overridePathMappings [ res [ 1 ] ] === 'string' ) {
42
- if ( configuration . routes . overridePathMappings [ res [ 1 ] ] !== '*' ) {
43
- writeIndexHtml ( cwd , file , configuration . routes . overridePathMappings [ res [ 1 ] ] , template , configuration , cssFiles , jsFiles ) ;
41
+ const pageName = res [ 1 ] . replace ( / \/ $ / u, '' ) ;
42
+ console . log ( pageName ) ;
43
+ if ( typeof configuration . routes . overridePathMappings [ pageName ] === 'string' ) {
44
+ if ( configuration . routes . overridePathMappings [ pageName ] !== '*' ) {
45
+ writeIndexHtml ( cwd , file , configuration . routes . overridePathMappings [ pageName ] , template , configuration , cssFiles , jsFiles ) ;
46
+ } else {
47
+ writeIndexHtml ( cwd , file , '' , template , configuration , cssFiles , jsFiles ) ;
44
48
}
45
49
} else {
46
- writeIndexHtml ( cwd , file , `/${ res [ 1 ] } /` , template , configuration , cssFiles , jsFiles ) ;
50
+ writeIndexHtml ( cwd , file , `/${ pageName } /` , template , configuration , cssFiles , jsFiles ) ;
47
51
}
48
52
}
49
53
}
0 commit comments