feat(@angular/cli): use separate tsconfigs#4924
Conversation
cde4917 to
6ddbcb5
Compare
This PR adds tsconfigs for each separate application: - `src/tsconfig.app.json`: configuration for the Angular app. - `src/tsconfig.spec.json`: configuration for the unit tests. Defaults to the Angular app config. - `e2e/tsconfig.e2e.json`: configuration for the e2e tests. There is an additional root-level `tsconfig.json` that is used for editor integration. For Angular version 4 projects, these tsconfigs will use inheritance since it's available with TypeScript 2.1. This is not a breaking change. Existing projects should not be affected.
6ddbcb5 to
5085bf7
Compare
|
fiesta! 💃 |
|
Olé! 💃 |
|
LGTM 💃 |
| "target": "es5", | ||
| "module": "es2015", | ||
| "baseUrl": "", | ||
| "types": [] |
There was a problem hiding this comment.
@filipesilva A bit late question but why declaring types manually is better than having one global typeRoots (as there was before)?
"typeRoots": [
"../node_modules/@types"
]There was a problem hiding this comment.
A couple of reasons:
- Some typings might actually have duplicate indentifiers. This has happened before with
protractorandjqueryboth using$. - You might be using typings that really don't shouldn't in your app, like
describethat should only be in unit tests, or node typings.
That being said, it is more convenient to use typeRoots if you're not too concerned with those things.
There was a problem hiding this comment.
Sounds convincing! Thanks for such a detail comment!! 🍺 🍺
There was a problem hiding this comment.
This was hard to dig out, but thanks for clarifying. 👍
|
Just want to leave a comment about my issue - the statement above that "existing projects should not be affected" isn't entirely true... |
|
Ah. Cool. Also running into an issue where building/ng serve-ing the app is showing an error that it can't find a type (Auth0UserProfile in this case), but it's defined in the @types/auth0-js library, and VS code sees it fine. The code runs fine, but not sure why the build is squawking... |
|
That's likely because you have to add it to the |
|
Was just about to make a comment about that too... would be nice if there was a mention in the rc.0 update docs to watch out for third party libs... Thanks |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This PR adds tsconfigs for each separate application:
src/tsconfig.app.json: configuration for the Angular app.src/tsconfig.spec.json: configuration for the unit tests. Defaults to the Angular app config.e2e/tsconfig.e2e.json: configuration for the e2e tests.There is an additional root-level
tsconfig.jsonthat is used for editor integration.For new Angular version 4 projects, these tsconfigs will use inheritance since it's available with TypeScript 2.1.
This is not a breaking change. Existing projects should not be affected.