`ng serve` 输出文件到哪里? [英] Where does `ng serve` output files to?
问题描述
ng serve
没有按照我在 apps[0].outDir
中的 angular-cli.json 中设置的路径构建.
ng serve
is not building to the path that I have set in my angular-cli.json in apps[0].outDir
.
ng build
正常工作并构建到我指定的路径.
ng build
works correctly and builds to the path that I have specified.
推荐答案
ng serve
构建在内存中是正确的.
It's correct that ng serve
builds in memory.
Angular CLI 不支持同时运行服务器和写入磁盘.
Angular CLI does not have support for running a server and writing to disk at the same time.
如果你使用自己的服务器等,你可以使用ng build --watch
,它会像ng serve
一样监视文件,但是会写它们到磁盘,并且不会运行服务器.
If you are using your own server, etc., you can use ng build --watch
, which will watch files just like ng serve
, but will write them to disk, and will not run a server.
查看有关如何从磁盘提供文件的官方文档:
https://github.com/angular/angular-cli/wiki/stories-磁盘服务
Check this official documentation on how to serve files from disk:
https://github.com/angular/angular-cli/wiki/stories-disk-serve
这篇关于`ng serve` 输出文件到哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!