prevent ng build from overwriting source files
- Dominant language
- TypeScript
- Stars
- 27k
- Forks
- 11.8k
- Avg merge
- 14h 23m
- Merged PRs (30d)
- 162
Description
Okay, that one was scarry as hell. I am sooo lucky I pushed my project to GH before building ng sources prepared for prod....
What I did was opening .angular-cli.json and setting
"outDir": "../../",
as I wanted to store built files next to my project so that I could simply exclude project in gradle. Turns out that was a terrible mistake as ng build --prod decided to nuked my whole UI project for good. Yes sir it did. 10 days of work have been completely vanished from my harddrive. Good thing is that I did push it all to git before...
I would strongly suggest to add safety switches preventing self-destruction in the whole ng-cli project.
Contributor guide
Research direction
Start with .angular-cli.json and reproduce the reported ng build --prod behavior using an outDir of ../../. Trace how the Angular CLI handles that output path and define a safety switch that prevents destructive writes outside the project.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100