Reputation: 1
Angular generates a lot of trash from a .ts
file.
app.component.js
app.component.spec.js.map
app.component.js.map
app.component.spec.ts
app.component.spec.js
Is there any simple way to delete of that, a lot of build systems support clean
,
make clean
git clean
How do you do this in angular
npm install
npm start
Now from the main.ts
you now have main.js
and main.js.map
In my own project, where I'm working along with the angular-cli, I actually have .spec
files too.
Upvotes: 11
Views: 56339
Reputation: 1
As a matter of trivia, the Tour of Hereos demo was not created (yet) with the Angular CLI but it is set to change. To remove the build files, I've been using this.
find ./src/ -name '*.ts' -print0 |
sed -z -e's/\.ts$/.*$/' |
xargs -0 -I pattern find ./src -type f -not -name '*.ts' -regex pattern -exec rm {} \;
Upvotes: 0
Reputation: 60528
Are you using the Angular CLI? If so, by default it no longer generates all of these "trash" files.
Upvotes: 1
Reputation: 479
Check this method
I make build: ng build --env prod which will write it under dist folder Then I run ng serve and my build is gone.
Upvotes: 3