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,并且将angular-cli
的beta 11.webpack
升级了,而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屋!