How can I exclude files from the angular build using angular-cli. I just add the path to exclude in the tsconfig.json
and tsconfig.app.json
files but when I run ng serve
, angular still trying to compile the files.
Any ideas?
How can I exclude files from the angular build using angular-cli. I just add the path to exclude in the tsconfig.json
and tsconfig.app.json
files but when I run ng serve
, angular still trying to compile the files.
Any ideas?
Using exclude
property of tsconfig.json
(at root level), i.e.:
{
"exclude": [
"node_modules",
"**/*.spec.ts"
]
}
You can use ng eject
to get the webpack.config.js. You can modify this to your needs. However, you will not be able to use ng serve
or ng build
after that.
For using these commands again, you have to modify .angular-cli.json
. Remove the property 'projects.ejected' or set it to false. How to undo Angular 2 Cli ng-eject
I noticed if you put a .
in front of the path it will work:
{
"extends": "../tsconfig.json",
"compilerOptions": {
...
},
"exclude": [
...
"./yourPathToExclude/**/*"
]
}