Angular 9 Upgrade updates to tsconfig.app.json are undocumented.
See original GitHub issueđ Docs or angular.io bug report
Description
The Angular 9 upgrade updated the tsconfig.app.json and tsconfig-es5.app.json as follows (the project uses the differential loading workaround from the angular 8 upgrade to allow ng serve to support IE):
tsconfig.app.json
Old:
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"types": []
},
"exclude": [
"src/test.ts",
"**/*.spec.ts"
]
}
New:
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "../out-tsc/app",
"types": []
},
"files": [
"main.ts",
"polyfills.ts"
],
"include": [
"src/**/*.d.ts"
]
}
(i.e.) âexcludeâ was removed and âfilesâ and âincludeâ were added.
tsconfig-es5.app.json
Old:
{
"extends": "./tsconfig.app.json",
"compilerOptions": {
"target": "es5"
}
}
New:
{
"extends": "./tsconfig.app.json",
"compilerOptions": {
"target": "es5"
}
, "include": [
"src/**/*.d.ts"
]
}
Checking the tsconfig.app.json for a default CLI Angular 8 project upgraded to 9 the file is:
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.ts"
],
"exclude": [
"src/test.ts",
"src/**/*.spec.ts"
]
}
This seems to be the only information about this in the upgrade documentation: We have updated the tsconfig.app.json to limit the files compiled. If you rely on other files being included in the compilation, such as a typings.d.ts file, you need to manually add it to the compilation.
I think the addition of the include statement may be related to: https://github.com/angular/angular-cli/issues/16923.
And the addition of files may be related to: https://github.com/angular/angular-cli/issues/17066
Why were these changes made? Why was the âexcludeâ statement removed? Why are the changes different for the es5 file?
Please update the upgrade documentation to include information about why these the upgrader is makes these changes.
Whatâs the affected URL?**
https://update.angular.io/#8.0:9.0l3 https://angular.io/guide/updating-to-version-9
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9 (4 by maintainers)
Top GitHub Comments
What does the âdâ mean in âsrc/**/*.d.tsâ? It includes files that donât have a âdâ and excludes other files. And whatâs the difference between âfilesâ and âincludeâ? Which files or paths go where?
I referred this question on Enterprise slack group and @mgechev confirmed me my assumption was correct! As @devin5885 explained, we may need to explicitly include the additional files to be compiled.
IMO this change is for simplification, but unfortunately, itâs not documented anywhere!
I just shared this information, so that, if anyone is looking for this, it may be helpful!