Angular 2 with CLI - build for production

后端 未结 9 1860
夕颜
夕颜 2021-02-01 16:18

I have freshly installed angular-cli 1.0.0.beta.17 (latest one), start new project, able to serve project on port 4200 with no problems - just standard \"app works!\" message.

9条回答
  •  走了就别回头了
    2021-02-01 16:44

    You want the AOT, which is implied by the use of the -prod switch. Unfortunately, when Angular CLI itself breaks, the error messages are not helpful. This is how I solved it:

    npm install enhanced-resolve@3.3.0

    I found the solution a long, long way down this page: https://github.com/angular/angular-cli/issues/7113

    I've seen some mention that updating Angular CLI version to at least 1.2.6. gets around the problem as well, but haven't tested it yet.

提交回复
热议问题