How do I build with watch enabled using angular-cli?

后端 未结 3 627
闹比i
闹比i 2020-12-14 00:57

I don\'t want to use serve, I know it watches for changes, builds and serves. I want to build upon changes. According to \"ng help\", build takes parameter --watch

3条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-14 01:23

    The ng build --watch looks for the path: dist to watch the changes. But as per the new version of the Angular, the default output path will be dist/.

    So you need to mention the output directory through command line like

    ng build --output-path dist --watch
    

    or

    you can change the default location in angular.json... -> options -> outputPath: dist/ to dist and simply run ng build --watch

提交回复
热议问题