test(es/module): Add a test for a fixed issue (#8521)

**Related issue:**

 - Closes #8375
This commit is contained in:
Donny/강동윤 2024-01-19 12:39:42 +09:00 committed by GitHub
parent a8518410da
commit 4b4a0a244d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 65 additions and 0 deletions

View File

@ -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"
}
}

View File

@ -0,0 +1,5 @@
import { helloWorld } from "hello";
import * as Sentry from '@sentry/node';
Sentry;
helloWorld("SWC");

View File

@ -0,0 +1,3 @@
export function helloWorld(name: string) {
console.log(`Hello, ${name}`);
}

View File

@ -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__*/

View File

@ -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}`);
}