File tree 3 files changed +8
-6
lines changed
swc_ecma_loader/src/resolvers
swc_ecma_transforms_module/src
3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -419,7 +419,7 @@ impl NodeModulesResolver {
419
419
module_specifier, base, self . target_env
420
420
) ;
421
421
422
- {
422
+ if !module_specifier . starts_with ( '.' ) {
423
423
// Handle absolute path
424
424
425
425
let path = Path :: new ( module_specifier) ;
Original file line number Diff line number Diff line change @@ -319,11 +319,13 @@ where
319
319
}
320
320
}
321
321
322
- let path = self . base_url . join ( module_specifier) ;
322
+ if !module_specifier. starts_with ( '.' ) {
323
+ let path = self . base_url . join ( module_specifier) ;
323
324
324
- // https://www.typescriptlang.org/docs/handbook/modules/reference.html#baseurl
325
- if let Ok ( v) = self . invoke_inner_resolver ( base, & path. to_string_lossy ( ) ) {
326
- return Ok ( v) ;
325
+ // https://www.typescriptlang.org/docs/handbook/modules/reference.html#baseurl
326
+ if let Ok ( v) = self . invoke_inner_resolver ( base, & path. to_string_lossy ( ) ) {
327
+ return Ok ( v) ;
328
+ }
327
329
}
328
330
329
331
self . invoke_inner_resolver ( base, module_specifier)
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ use std::{
2
2
borrow:: Cow ,
3
3
env:: current_dir,
4
4
fs:: read_link,
5
- io,
5
+ io:: { self } ,
6
6
path:: { Component , Path , PathBuf } ,
7
7
sync:: Arc ,
8
8
} ;
You can’t perform that action at this time.
0 commit comments