Skip to content

Commit 4068210

Browse files
authored
feat(cli): new typescript projects use modern tsconfig (#429)
Changed target, module, moduleResolution, and lib to more modern TS settings. This sets a newer default, which prevents import errors when importing other packages that use the `exports` map for defining entrypoints. While the settings in this template will not fit all use-cases, it sets a better example for future modifications (i.e. should specify moduleResolution). Fixes #427 --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
1 parent 256fe96 commit 4068210

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

packages/aws-cdk/lib/init-templates/app/typescript/tsconfig.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"compilerOptions": {
3-
"target": "ES2020",
4-
"module": "commonjs",
3+
"target": "ES2022",
4+
"module": "NodeNext",
5+
"moduleResolution": "NodeNext",
56
"lib": [
6-
"es2020"
7+
"es2022"
78
],
89
"declaration": true,
910
"strict": true,

packages/aws-cdk/lib/init-templates/lib/typescript/tsconfig.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"compilerOptions": {
3-
"target": "ES2020",
4-
"module": "commonjs",
3+
"target": "ES2022",
4+
"module": "NodeNext",
5+
"moduleResolution": "NodeNext",
56
"lib": [
6-
"es2020"
7+
"es2022"
78
],
89
"declaration": true,
910
"strict": true,
@@ -25,6 +26,6 @@
2526
},
2627
"exclude": [
2728
"node_modules",
28-
"cdk.out",
29+
"cdk.out"
2930
]
3031
}

packages/aws-cdk/lib/init-templates/sample-app/typescript/tsconfig.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"compilerOptions": {
3-
"target": "ES2020",
4-
"module": "commonjs",
3+
"target": "ES2022",
4+
"module": "NodeNext",
5+
"moduleResolution": "NodeNext",
56
"lib": [
6-
"es2020"
7+
"es2022"
78
],
89
"declaration": true,
910
"strict": true,

0 commit comments

Comments
 (0)