Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we exclude tsconfig.spec.json from an angular application

I'm a newbie in Angular. I came across the files tsconfig.app.json, tsconfig.spec.json when angular app was installed using Angular-CLI and found the following point useful from this link.

Both tsconfig.*.json files are for TypeScript configuration. tsconfig.app.json is used for compiling the code, while tsconfig.spec.json for compiling the tests.

My doubt is, can we completely exclude tsconfig.spec.json file if we are not using any test environment? Or is tsconfig.spec.json mandatory?

like image 235
kmg Avatar asked Feb 25 '19 11:02

kmg


1 Answers

If you don't use tests, feel free to remove tsconfig.spec.json.

Actually you can generate a new angular app without setting up test environment (karma, protractor and *.spec.ts files)

for @angular/cli version 7,8,9 the command is:

ng new --minimal=true --skipTests=true your-app-name

for @angular/cli version 6:

ng new --minimal --skip-tests your-app-name

This will remove unnecessary complexity from configuration files which is a nice thing if you just started learning angular.

like image 99
Evgeniy Malyutin Avatar answered Oct 12 '22 11:10

Evgeniy Malyutin