Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 03180fe

Browse filesBrowse files
clydinalan-agius4
authored andcommitted
feat(@schematics/angular): use TypeScript module preserve option for new projects
Newly generated projects will now use the `preserve` value for the `module` option within the TypeScript configuration for the workspace (`tsconfig.json`). This value was added in TypeScript 5.4 and is intended to model the behavior of modern bundlers such as used in the default `application` builder. This option value also has the advantage of automatically enabling `esModuleInterop` and setting `moduleResolution` to `bundler` which are the currently generated values for new projects. This allows explicit use of these options to be removed from the generated file. The `resolveJsonModule` option is also enabled with `preserve` which removes the need for developers to manually add it if JSON files are imported. JSON file imports are fully support including unused property treeshaking with named imports in the `application` builder. Additional details on the option can be found here: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-4.html#support-for-require-calls-in---moduleresolution-bundler-and---module-preserve
1 parent 29243fb commit 03180fe
Copy full SHA for 03180fe

1 file changed

+1-3Lines changed: 1 addition & 3 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/schematics/angular/workspace/files/tsconfig.json.template‎

Copy file name to clipboardExpand all lines: packages/schematics/angular/workspace/files/tsconfig.json.template
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@
1111
"noFallthroughCasesInSwitch": true,<% } %>
1212
"skipLibCheck": true,
1313
"isolatedModules": true,
14-
"esModuleInterop": true,
1514
"experimentalDecorators": true,
16-
"moduleResolution": "bundler",
1715
"importHelpers": true,
1816
"target": "ES2022",
19-
"module": "ES2022"
17+
"module": "preserve"
2018
},
2119
"angularCompilerOptions": {
2220
"enableI18nLegacyMessageIdFormat": false<% if (strict) { %>,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.