File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -643,17 +643,18 @@ export async function main(argv, options) {
643
643
644
644
// Include entry files
645
645
for ( let i = 0 , k = argv . length ; i < k ; ++ i ) {
646
- const filename = argv [ i ] ;
647
- let sourcePath = String ( filename )
648
- . replace ( / \\ / g, "/" )
649
- . replace ( extension_re , "" )
650
- . replace ( / [ \\ / ] $ / , "" ) ;
646
+ const filename = String ( argv [ i ] ) ;
651
647
652
648
// Setting the path to relative path
653
- sourcePath = path . isAbsolute ( sourcePath )
654
- ? path . relative ( baseDir , sourcePath ) . replace ( / \\ / g , "/" )
655
- : sourcePath ;
649
+ let sourcePath = path . isAbsolute ( filename )
650
+ ? path . relative ( baseDir , filename )
651
+ : path . normalize ( filename ) ;
656
652
653
+ sourcePath = sourcePath
654
+ . replace ( / \\ + / g, "/" )
655
+ . replace ( extension_re , "" )
656
+ . replace ( / [ \\ / ] $ / , "" ) ;
657
+
657
658
// Try entryPath.ext, then entryPath/index.ext
658
659
let sourceText = await readFile ( sourcePath + extension , baseDir ) ;
659
660
if ( sourceText == null ) {
You can’t perform that action at this time.
0 commit comments