File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -651,17 +651,18 @@ export async function main(argv, options) {
651651
652652 // Include entry files
653653 for ( let i = 0 , k = argv . length ; i < k ; ++ i ) {
654- const filename = argv [ i ] ;
655- let sourcePath = String ( filename )
656- . replace ( / \\ / g, "/" )
657- . replace ( extension_re , "" )
658- . replace ( / [ \\ / ] $ / , "" ) ;
654+ const filename = String ( argv [ i ] ) ;
659655
660656 // Setting the path to relative path
661- sourcePath = path . isAbsolute ( sourcePath )
662- ? path . relative ( baseDir , sourcePath ) . replace ( / \\ / g , "/" )
663- : sourcePath ;
657+ let sourcePath = path . isAbsolute ( filename )
658+ ? path . relative ( baseDir , filename )
659+ : path . normalize ( filename ) ;
664660
661+ sourcePath = sourcePath
662+ . replace ( / \\ / g, "/" )
663+ . replace ( extension_re , "" )
664+ . replace ( / \/ $ / , "" ) ;
665+
665666 // Try entryPath.ext, then entryPath/index.ext
666667 let sourceText = await readFile ( sourcePath + extension , baseDir ) ;
667668 if ( sourceText == null ) {
You can’t perform that action at this time.
0 commit comments