Skip to content

Commit

Permalink
test(es/module): Add a test for a fixed issue (#8521)
Browse files Browse the repository at this point in the history
**Related issue:**

 - Closes #8375
  • Loading branch information
kdy1 authored Jan 19, 2024
1 parent a851841 commit 4b4a0a2
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
35 changes: 35 additions & 0 deletions crates/swc/tests/fixture/issues-8xxx/8375/1/input/.swcrc
Original file line number Diff line number Diff line change
@@ -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"
}
}
5 changes: 5 additions & 0 deletions crates/swc/tests/fixture/issues-8xxx/8375/1/input/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { helloWorld } from "hello";
import * as Sentry from '@sentry/node';

Sentry;
helloWorld("SWC");
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function helloWorld(name: string) {
console.log(`Hello, ${name}`);
}
9 changes: 9 additions & 0 deletions crates/swc/tests/fixture/issues-8xxx/8375/1/output/index.ts
Original file line number Diff line number Diff line change
@@ -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__*/
Original file line number Diff line number Diff line change
@@ -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}`);
}

0 comments on commit 4b4a0a2

Please sign in to comment.