Files
spartan-ng__spartan/libs/tools/tsconfig.json
Ashley Hunter 63bf4fe4f1 fix(cli): emit CommonJS so generators load in compat mode
The nx 22 / angular 21 upgrade (#1430) switched the cli tsconfig to
`module: preserve` with `moduleResolution: bundler`. With `preserve`,
TypeScript keeps the ESM import/export syntax in the emitted .js files,
but the published package declares `"type": "commonjs"`. Node then loads
the generator files (e.g. compat.js) as CommonJS and throws
"Cannot use import statement outside a module", breaking every
`ng g @spartan-ng/cli:*` command from alpha.708 onwards.

Restore `module: commonjs` (with `moduleResolution: node`) so the build
output matches the package type again. The same harmless mismatch is
corrected in libs/tools for consistency; tools runs from source and is
never published, so it was not affected at runtime.

Closes #1451
2026-06-10 12:59:38 +01:00

20 lines
313 B
JSON

{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"resolveJsonModule": true,
"esModuleInterop": true,
"moduleResolution": "node"
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}