Loading...
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node"
}
}{
"compilerOptions": {
"module": "nodenext",
"moduleResolution": "nodenext"
}
}'nodenext' follows Node's real ESM and CommonJS rules, including exports maps, unlike the legacy 'node' mode.
moduleResolution and module are set together, as 'nodenext' requires module: 'nodenext'.With 'nodenext' the import path must match the emitted file. TypeScript maps './utils.js' back to 'utils.ts' when checking.
Yes. It reads the exports field of package.json and allows imports without file extensions, like most bundlers.
No. paths only affects type checking; the bundler or runtime needs its own alias config.