ng serve remove /dist

After update Jan 2017 noticed new problem. Command ng serve remove /dist dir.

ALERT MAY 2017 – not this is outdated, angular4 repair bug,

Solution (only for angular2, not! angular4):

File: package.json (new command prod-build)

  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "prod-build": "ng build --output-path=last-build/ --env=prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"

File: angular-cli.json (change ourDir)

      "outDir": "/tmp/dist",


To build your prod version run: npm run prod-build

To server: ng serve

In this configuration: ng server will create tmp dir, and your project directory will be clean, even when you commit changes without stop ng serve.