angular / angular/angular-cli

prevent ng build from overwriting source files

Open
#6,485 3 comments 2 reactions 0 assignees View on GitHub
area: @angular-devkit/build-angular freq1: low severity2: inconvenient type: bug/fix
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.