mirror of
https://github.com/spartan-ng/spartan.git
synced 2026-09-22 16:41:38 +08:00
63bf4fe4f1
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
257 B
257 B