Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

232
Visualizações
Angular-cli ignores tsconfig.json

Using

"@angular/cli": "^1.0.0"

@angular/cli ignores tsconfig.json

The project compiles just fine editing / removing tsconfig.json

Why is that?

about 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

The reason that your project compiles without $ROOT/tsconfig.json is that @angular/cli supports multiple apps within the root directory; your (single) app is compiling with $ROOT/src/tsconfig.app.json and your test suite with $ROOT/src/tsconfig.spec.json. The root tsconfig.json applies to all apps within the directory. Deleting it simply removed the global tsconfig that could potentially be used with many apps.

For a clearer understanding of this, look at .angular-cli.json. One property, app, supports an array of multiple applications, but the default configuration is for one application alone. As described in @angular/cli/lib/config/schema.json, app supports "properties of the different applications in this project."

"app": [{
  "root": "src"
  ...
  "tsconfig": "tsconfig.app.json",
  "testTsconfig": "tsconfig.spec.json"
}]

Using this array, you could have as many Angular apps as you like, each with its own specific TypeScript settings.

Additionally, @angular/cli's commands support multiple applications with the --app flag. ng serve --app foo will serve the foo app, whereas ng serve --app bar will serve the bar app. This flag also works with ng build, ng e2e, ng eject, ng test, and ng xi18n. To add a new app to your existing $ROOT directory, use ng new.

The root tsconfig is not just for code editors and tslint. It applies globally to all apps in your project. How this works under the hood is rather complex, as is clear from the source code, where there are numerous json files that have lines such as "extends": "../../../tsconfig.json".

about 4 years ago · Santiago Trujillo Relatório

0

As stupid as it may seem, the angular-cli 's tsconfig.json file is located inside src/tsconfig.app.json

The root tsconfig.json will be used by editors (such as vscode).

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda