File tree 1 file changed +9
-8
lines changed
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) {
651
651
652
652
// Include entry files
653
653
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 ] ) ;
659
655
660
656
// 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 ) ;
664
660
661
+ sourcePath = sourcePath
662
+ . replace ( / \\ / g, "/" )
663
+ . replace ( extension_re , "" )
664
+ . replace ( / \/ $ / , "" ) ;
665
+
665
666
// Try entryPath.ext, then entryPath/index.ext
666
667
let sourceText = await readFile ( sourcePath + extension , baseDir ) ;
667
668
if ( sourceText == null ) {
You can’t perform that action at this time.
0 commit comments