File tree 7 files changed +36
-7
lines changed
tests/fixture/issues-6xxx/6782/1
swc_ecma_transforms_module/src
7 files changed +36
-7
lines changed Original file line number Diff line number Diff line change @@ -1327,12 +1327,10 @@ impl ModuleConfig {
1327
1327
available_features : FeatureFlag ,
1328
1328
) -> Box < dyn swc_ecma_visit:: Fold + ' cmt > {
1329
1329
let base = match base {
1330
- FileName :: Real ( path) if !paths. is_empty ( ) && !path. is_absolute ( ) => FileName :: Real (
1331
- std:: env:: current_dir ( )
1332
- . map ( |v| v. join ( path) )
1333
- . unwrap_or_else ( |_| path. to_path_buf ( ) ) ,
1334
- ) ,
1335
- _ => base. to_owned ( ) ,
1330
+ FileName :: Real ( v) if !paths. is_empty ( ) => {
1331
+ FileName :: Real ( v. canonicalize ( ) . unwrap_or_else ( |_| v. to_path_buf ( ) ) )
1332
+ }
1333
+ _ => base. clone ( ) ,
1336
1334
} ;
1337
1335
1338
1336
match config {
Original file line number Diff line number Diff line change
1
+ {
2
+ "minify" : true ,
3
+ "jsc" : {
4
+ "parser" : {
5
+ "syntax" : " typescript" ,
6
+ "tsx" : true ,
7
+ "dynamicImport" : true
8
+ },
9
+ "target" : " es2020" ,
10
+ "baseUrl" : " ./" ,
11
+ "paths" : {
12
+ "@/config" : [
13
+ " config"
14
+ ],
15
+ "@/config/*" : [
16
+ " config/*"
17
+ ]
18
+ }
19
+ }
20
+ }
Original file line number Diff line number Diff line change
1
+ export const config = ( ) => console . log ( "\n\n--> all good!\n\n" ) ;
Original file line number Diff line number Diff line change
1
+ import { config } from "@/config" ;
2
+
3
+ const main = ( ) => config ( ) ;
4
+
5
+ main ( ) ;
6
+
7
+ // See https://github.com/swc-project/swc/issues/6782
8
+ // See https://github.com/swc-project/swc/issues/6858
Original file line number Diff line number Diff line change
1
+ export const config = ( ) => console . log ( "\n\n--> all good!\n\n" ) ;
Original file line number Diff line number Diff line change
1
+ import { config } from "../config" ; const main = ( ) => config ( ) ; main ( ) ;
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ where
116
116
let mut p = PathBuf :: from ( target_path) ;
117
117
118
118
if cfg ! ( debug_assertions) {
119
- trace ! ( "to_specifier: orig_ext={:?}" , orig_ext) ;
119
+ trace ! ( "to_specifier({target_path}) : orig_ext={:?}" , orig_ext) ;
120
120
}
121
121
122
122
if let Some ( orig_ext) = orig_ext {
You can’t perform that action at this time.
0 commit comments