Skip to content

Feature Request: Stop deleting 'dist' directory on 'ng serve' (SILENTLY) #6375

Closed
@JasonGoemaat

Description

@JasonGoemaat

Bug Report or Feature Request (mark with an x)

- [X] feature request

Versions.

@angular/cli: 1.0.0-rc.1
node: 6.10.2
os: win32 x64
@angular/common: 2.4.9
@angular/compiler: 2.4.9
@angular/core: 2.4.9
@angular/forms: 2.4.9
@angular/http: 2.4.9
@angular/platform-browser: 2.4.9
@angular/platform-browser-dynamic: 2.4.9
@angular/router: 3.4.9
@angular/cli: 1.0.0-rc.1
@angular/compiler-cli: 2.4.9

Repro steps.

run "ng build" then "ng serve"

Desired functionality.

'ng serve' silently deletes the hard-coded 'dist' directory and should not.

Mention any other details that might be useful.

'ng serve' currently deletes the dist directory contents despite having nothing to do with the 'dist' directory. AND IT DOES THIS SILENTLY. The user might build into a different directory and store important information in the dist directory, which they would lose when calling 'ng serve'. People might use the dist directory for a lot of things. They might WANT to check in their weekly builds, either into the same repository or as a submodule so it can be imported into another project to serve the files. They might have a standard at their company to store things in a dist directory and build into a different directory, then 'ng serve' would delete files it has zero rights to delete.

If this is just done because people mistakenly think that 'ng seve' is serving the contents of the 'dist' directory it is a user education item and should be handled by a message when running 'ng serve' explaining this, not by silently deleting files.

A command line parameter like ng serve --keep-dist would be ok. At the very least there should be a message when running ng serve telling the user that it is deleting the contents of a directory.

Metadata

Metadata

Assignees

Labels

P5The team acknowledges the request but does not plan to address it, it remains open for discussioneffort1: easy (hours)severity2: inconvenient

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions