Skip to content

Commit

Permalink
feat(build): support hybrid CJS/ESM setups
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This changes TypeScript's default behaviour away from forcing CommonsJS mode, and to support generatng ESM files in accordance with Node.js' algorithm

Projects may be affected if you use `lb-tsc` and/or extend `tsconfig.*.json`
from `@loopback/build`, and:

- have `type: module` in `package.json`, or
- have `.mts` files, or
- use `import()`s (regardless if file ext. is `.ts`/`.mts`/`.cts`)

see: https://www.typescriptlang.org/tsconfig/#moduleResolution
see: #10744
Signed-off-by: Rifa Achrinza <[email protected]>
  • Loading branch information
achrinza committed Nov 17, 2024
1 parent d6b5183 commit 43f5d83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/build/config/tsconfig.common.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"incremental": true,

"lib": ["es2020"],
"module": "commonjs",
"module": "node16",
"esModuleInterop": true,
"moduleResolution": "node",
"moduleResolution": "node16",
"target": "es2018",
"sourceMap": true,
"declaration": true,
Expand Down

0 comments on commit 43f5d83

Please sign in to comment.