fix(es/modules): Remove wrong check for jsc.paths (#6470)

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6466.
This commit is contained in:
Donny/강동윤 2022-11-18 15:35:49 +09:00 committed by GitHub
parent e8b0b1c344
commit 072bd13023
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 8 deletions

View File

@ -121,13 +121,17 @@ where
if let Some(orig_ext) = orig_ext {
let use_orig = if let Some(ext) = p.extension() {
(ext == "ts" || ext == "tsx") && p.is_file()
ext == "ts" || ext == "tsx"
} else {
false
};
if use_orig {
if matches!(orig_ext, "js" | "mjs" | "cjs" | "jsx") {
p.set_extension(orig_ext);
} else {
p.set_extension("");
}
}
} else {
p.set_extension("");

View File

@ -1 +1 @@
import "./rel.ts";
import "./rel.js";

View File

@ -1 +1 @@
import "./src/feat.ts";
import "./src/feat.js";

View File

@ -1 +1 @@
import "./src/rel.decorator.ts";
import "./src/rel.decorator.js";

View File

@ -1 +1 @@
import "./src/rel.decorator.ts";
import "./src/rel.decorator";

View File

@ -1 +1 @@
import "./src/rel.decorator.ts";
import "./src/rel.decorator.js";

View File

@ -1 +1 @@
import "./src/rel.decorator.ts";
import "./src/rel.decorator";