Closed maxburs closed 4 months ago
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
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.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
.swcrc
Reproduction: https://github.com/maxburs/swc-node