diff --git a/example.ts b/example.ts index a201bd7..72366c4 100644 --- a/example.ts +++ b/example.ts @@ -1 +1,7 @@ -console.log('Some .ts code reproducing a bug'); +const example = async () => { + const other = await import('./other') + console.log(other) +} + +example().then(() => console.log(`done`)) + diff --git a/other.ts b/other.ts new file mode 100644 index 0000000..dedd3ac --- /dev/null +++ b/other.ts @@ -0,0 +1 @@ +export const foo = "bar" diff --git a/package.json b/package.json index 4d56496..ed08855 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,8 @@ { "dependencies": { "ts-node": "latest", - "typescript": "latest" + "typescript": "latest", + "@swc/core": "^1.2.95", + "@swc/helpers": "^0.2.13" } } diff --git a/run.sh b/run.sh index d553b44..9a71837 100644 --- a/run.sh +++ b/run.sh @@ -7,7 +7,7 @@ n lts yarn # Run ts-node -yarn ts-node ./example.ts +yarn ts-node --project ./tsconfig.json ./example.ts echo "Process exited with code: $?" echo diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..b64c642 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "ts-node/node16/tsconfig.json", + + "ts-node": { + "transpileOnly": true, + "transpiler": "ts-node/transpilers/swc-experimental" + }, + + "include": ["*.ts"], + "exclude": ["node_modules"] + } + \ No newline at end of file