Angular-cli: Execute ng build or npm start deleting dist directory

Created on 23 Feb 2017  路  3Comments  路  Source: angular/angular-cli

Hi, in previous version when executing ng build or npm start had no effect on dist directory that was created when executing ng build. After upgraded with current version, the dist directory will get deleted when running ng serve or npm start. Is this a feature or a bug? Please advice. Thank you.

  • Mac OSX

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:
@angular/cli: 1.0.0-beta.32.3
node: 6.10.0
os: darwin x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
yes, it is. I just upgraded to the new version of angular cli. Previous version was 1.0.0-beta.24.

The log given by the failure.

Normally this include a stack trace and some more information.

Mention any other details that might be useful.


Thanks! We'll be in touch soon.

All 3 comments

It's a feature. It avoids unexpected behaviours and ensure clean output.

If you need to preserve files in there, you are expected to use the assets property of apps elements in .angular-cli.json. This is a one-way sync, from the asset source to output folder. There is no support for opposite direction planned or expected.

Another option would be to use the proxy option for serve command if needed, which would redirect specific URLs to other servers etc.

Closing as answered. Thanks @Meligy !

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings