diff --git a/crates/swc/tests/fixture/issues-8xxx/8375/1/input/.swcrc b/crates/swc/tests/fixture/issues-8xxx/8375/1/input/.swcrc new file mode 100644 index 000000000000..daccaa9add2c --- /dev/null +++ b/crates/swc/tests/fixture/issues-8xxx/8375/1/input/.swcrc @@ -0,0 +1,35 @@ +{ + "jsc": { + "keepClassNames": true, + "output": { + "preamble": "" + }, + "parser": { + "syntax": "typescript" + }, + "baseUrl": ".", + "paths": { + "*": [ + "src/*" + ] + }, + "preserveAllComments": true, + "target": "es2022", + "transform": { + "decoratorMetadata": false, + "legacyDecorator": false + } + }, + "minify": false, + "module": { + "allowTopLevelThis": false, + "ignoreDynamic": false, + "lazy": false, + "noInterop": false, + "preserveImportMeta": false, + "resolveFully": false, + "strict": false, + "strictMode": true, + "type": "commonjs" + } +} \ No newline at end of file diff --git a/crates/swc/tests/fixture/issues-8xxx/8375/1/input/index.ts b/crates/swc/tests/fixture/issues-8xxx/8375/1/input/index.ts new file mode 100644 index 000000000000..780e46a5d812 --- /dev/null +++ b/crates/swc/tests/fixture/issues-8xxx/8375/1/input/index.ts @@ -0,0 +1,5 @@ +import { helloWorld } from "hello"; +import * as Sentry from '@sentry/node'; + +Sentry; +helloWorld("SWC"); \ No newline at end of file diff --git a/crates/swc/tests/fixture/issues-8xxx/8375/1/input/src/hello/index.ts b/crates/swc/tests/fixture/issues-8xxx/8375/1/input/src/hello/index.ts new file mode 100644 index 000000000000..b602b35254a5 --- /dev/null +++ b/crates/swc/tests/fixture/issues-8xxx/8375/1/input/src/hello/index.ts @@ -0,0 +1,3 @@ +export function helloWorld(name: string) { + console.log(`Hello, ${name}`); +} \ No newline at end of file diff --git a/crates/swc/tests/fixture/issues-8xxx/8375/1/output/index.ts b/crates/swc/tests/fixture/issues-8xxx/8375/1/output/index.ts new file mode 100644 index 000000000000..6b20956a05c5 --- /dev/null +++ b/crates/swc/tests/fixture/issues-8xxx/8375/1/output/index.ts @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +const _interop_require_wildcard = require("src/@swc/helpers/_/_interop_require_wildcard"); +const _hello = require("./src/hello"); +const _node = _interop_require_wildcard._(require("src/@sentry/node")); +_node; +(0, _hello.helloWorld)("SWC"); /*#__PURE__*/ diff --git a/crates/swc/tests/fixture/issues-8xxx/8375/1/output/src/hello/index.ts b/crates/swc/tests/fixture/issues-8xxx/8375/1/output/src/hello/index.ts new file mode 100644 index 000000000000..40ce8e0e514a --- /dev/null +++ b/crates/swc/tests/fixture/issues-8xxx/8375/1/output/src/hello/index.ts @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +Object.defineProperty(exports, "helloWorld", { + enumerable: true, + get: function() { + return helloWorld; + } +}); +function helloWorld(name) { + console.log(`Hello, ${name}`); +}