I've tried:
node --import @swc-node/register/esm-register script.ts
SWCRC=true node --import @swc-node/register/esm-register script.ts
SWC_NODE_PROJECT=null node --import @swc-node/register/esm-register script.ts
with no luck
If I set jsc.experimental.keepImportAssertions then I can get the cli to produce output that works.
Node v20.13.1
macOS 14.4.1 (23E224)
Yarn 4.2.2 (node_modules linker)
tsconfig.json
{
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "@tsconfig/node20/tsconfig.json",
"compilerOptions": {
"lib": ["es2023"],
"module": "NodeNext",
"moduleResolution": "NodeNext",
"target": "esnext",
"resolveJsonModule": true
}
}
.swcrc
{
"$schema": "https://swc.rs/schema.json",
"jsc": {
"parser": {
"syntax": "typescript",
"importMeta": true
},
"target": "es2022",
"experimental": {
"keepImportAssertions": true
}
},
"isModule": true
}
Reproduction: https://github.com/maxburs/swc-node
I've tried:
node --import @swc-node/register/esm-register script.tsSWCRC=true node --import @swc-node/register/esm-register script.tsSWC_NODE_PROJECT=null node --import @swc-node/register/esm-register script.tswith no luck
If I set jsc.experimental.keepImportAssertions then I can get the cli to produce output that works.
Node v20.13.1
macOS 14.4.1 (23E224)
Yarn 4.2.2 (node_modules linker)
tsconfig.json
{ "$schema": "https://json.schemastore.org/tsconfig", "extends": "@tsconfig/node20/tsconfig.json", "compilerOptions": { "lib": ["es2023"], "module": "NodeNext", "moduleResolution": "NodeNext", "target": "esnext", "resolveJsonModule": true } }.swcrc
{ "$schema": "https://swc.rs/schema.json", "jsc": { "parser": { "syntax": "typescript", "importMeta": true }, "target": "es2022", "experimental": { "keepImportAssertions": true } }, "isModule": true }Reproduction: https://github.com/maxburs/swc-node