Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paths in tsconfig in Angular CLI #24362

Closed
antonkarsten opened this issue Apr 9, 2017 · 4 comments
Closed

Paths in tsconfig in Angular CLI #24362

antonkarsten opened this issue Apr 9, 2017 · 4 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) javascript JavaScript support issues typescript Typescript support issues

Comments

@antonkarsten
Copy link

  • VSCode Version: 1.11
  • OS Version: Ubuntu 16

Steps to Reproduce:

  1. Checkout the following repo https://github.com/antonkarsten/sample
  2. Have a look at the tsconfig file is src/tsconfig.app.json (so it is not the tsconfig.json in the root). This is particular to angular-cli (https://cli.angular.io/)
    If you look on line 8 in src/app/app.module.ts you can see how I imported the button component. VSCode shows this as an error.
  3. But the project works because of the paths property in the tsconfig.app.json. When you run the project (with the command ng serve) everything is fine.

Maybe Im doing something wrong. Thats possible as well
Anton

@chrmarti
Copy link
Contributor

TypeScript does not look at tsconfig.app.json only at tsconfig.json from what I know. Maybe tsconfig.app.json is a template for the actual tsconfig.json?

@antonkarsten
Copy link
Author

antonkarsten commented Apr 10, 2017

Hi @chrmarti , thank you for your reply. As I understood tsconfig.json is only the default name for the file. Using the compiler you can actually specify the name of the file e.g. tsc --project tsconfig.app.json. Since there are multiple config files in the same folder the names need to be different.

Maybe there is a way to tell vscode which file(s) it should use?

the tsconfig.app.json file is not a template. it is used like that by Angular CLI

@mjbvz mjbvz added javascript JavaScript support issues typescript Typescript support issues *duplicate Issue identified as a duplicate of another issue(s) labels Apr 10, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Apr 10, 2017

@antonkarsten Currently you must use the files names tsconfig.json or jsconfig.json. One possible workaround is described here and we are tracking allowing you to specify project config filenames explicitly with #12463

@mjbvz mjbvz closed this as completed Apr 10, 2017
@nitzano
Copy link

nitzano commented Oct 7, 2017

Another workaround you can apply @angular/cli without adding new files is to remove the "baseUrl" property from tsconfig.app.json and tsconfig.spec.json and add to the root tsconfig.json the property "baseUrl": "./src/", as they both extend it and refer to the same directory (tested with @angular/cli@1.4.4).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) javascript JavaScript support issues typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

4 participants