Where does `ng serve` output files to?

Angular Cli

Angular Cli Problem Overview


ng serve is not building to the path that I have set in my angular-cli.json in apps[0].outDir.

ng build works correctly and builds to the path that I have specified.

Angular Cli Solutions


Solution 1 - Angular Cli

It's correct that ng serve builds in memory.

Angular CLI does not have support for running a server and writing to disk at the same time.

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.

Check this official documentation on how to serve files from disk:
https://github.com/angular/angular-cli/wiki/stories-disk-serve

Solution 2 - Angular Cli

Output is not written to disk when using ng serve. Everything will be kept in memory. Source: https://stackoverflow.com/questions/39256780/where-are-files-stored-when-running-ng-serve

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDaniel PatrickView Question on Stackoverflow
Solution 1 - Angular CliMeligyView Answer on Stackoverflow
Solution 2 - Angular CliSteven YatesView Answer on Stackoverflow