Closed magicmark closed 4 months ago
This has nothing to do with the tsconfig bases project, which is just shorthand for existing TS configs.
@jakebailey understood but dynamic imports are stage 4 - I would expect this to be supported out of the box.
So my issue here specifically is - should @tsconfig/node20/tsconfig.json
(and friends) be configured to support dynamic imports (without the double wrapping) without any extra userland overrides? I assume there's some combination of compilerOptions
that does this, but i'm unclear what this would be
It is configured to do that, but this is a runtime issue with TypeScript's CJS import helpers, so the issue should be files on TypeScript. This repo is just shorthand for copying a recommended tsconfig and isn't the right place to ask about this.
@jakebailey ack thanks https://github.com/microsoft/TypeScript/issues/59257
Repro
Runnable repro: https://stackblitz.com/edit/markl-ts-jest-repro-gbovnq?file=README.md
Relevant files:
foo.ts
bar.ts
tsconfig.json
Actual vs Expected behavior
This produces the following output:
Expected behavior is that it produces the following output:
(stackblitz runs on node 18, but this reproduces exactly on LTS (20) as well)
Thanks!