ng serve 不再使用新的 angular-cli webpack beta 生成 dist 文件夹 [英] ng serve doesn't generate dist folder anymore with new angular-cli webpack beta
问题描述
我最初使用 angular-cli
的 beta 10 启动了一个项目,当时我运行 ng serve
时,dist 文件夹将包含编译后的文件由 ng serve
生成.
I initially started a project with beta 10 of the angular-cli
, when I run ng serve
at that point of time the dist folder would contain the compiled files that were generated by ng serve
.
现在我将我的应用升级到 RC5 和 beta 11.webpack
的 angular-cli
和 ng serve
不会生成 dist文件夹了.这是有问题的,因为我有一个 Spring Boot 后端,它被配置为将 dist 文件夹映射为静态文件夹.
Now I upgraded my app to RC5 and beta 11.webpack
of the angular-cli
and ng serve
doesn't generate the dist folder anymore.
This is problematic because I have a Spring Boot backend which is configured to map the dist folder as it's static folder.
有没有办法用 webpack angular-cli 来实现这种行为?
Is there a way to get this behaviour with the webpack angular-cli as well?
angular-cli 的确切版本是:1.0.0-beta.11-webpack.2
Exact version of angular-cli is: 1.0.0-beta.11-webpack.2
重点是我需要从 ng serve 自动编译,我不想每次在源文件中进行更改时都运行 ng build.
the point is that I need the auto compile from ng serve, I don't want to run ng build every time I make a change in the source files.
推荐答案
只需使用 ng build --watch
.它将根据更改重建项目.
Just use ng build --watch
. It will be rebuilding the project on changes.
这篇关于ng serve 不再使用新的 angular-cli webpack beta 生成 dist 文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!