Skip to content

Commit 2d8bd9e

Browse files
authoredJan 21, 2024
fix(es/module): Fix handling of * in jsc.paths (#8535)
**Related issue:** - Closes #8375
1 parent 9c23f1c commit 2d8bd9e

File tree

3 files changed

+4
-4
lines changed
  • crates
    • swc/tests/fixture
    • swc_ecma_loader/src/resolvers

3 files changed

+4
-4
lines changed
 

‎crates/swc/tests/fixture/issues-8xxx/8375/1/output/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
Object.defineProperty(exports, "__esModule", {
33
value: true
44
});
5-
const _interop_require_wildcard = require("src/@swc/helpers/_/_interop_require_wildcard");
5+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
66
const _hello = require("./src/hello");
7-
const _node = _interop_require_wildcard._(require("src/@sentry/node"));
7+
const _node = _interop_require_wildcard._(require("@sentry/node"));
88
_node;
99
(0, _hello.helloWorld)("SWC"); /*#__PURE__*/

‎crates/swc/tests/fixture/jsc-paths/vercel-site/1/output/identity.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { nanoid } from "./nanoid";
1+
import { nanoid } from "nanoid";
22
import { fnv1a } from "../fnv1a";
33
export var VERCEL_AUTHENTICATED_PREFIX = "v_";
44
/**

‎crates/swc_ecma_loader/src/resolvers/tsc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ where
253253
Err(err) => err,
254254
});
255255

256-
if to.len() == 1 {
256+
if to.len() == 1 && !prefix.is_empty() {
257257
info!(
258258
"Using `{}` for `{}` because the length of the jsc.paths entry is \
259259
1",

0 commit comments

Comments
 (0)
Please sign in to comment.