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.
ng serve is a great command to use when developing your application locally. It starts up a local development server, which will serve your application while you are developing it. It is not meant to be used for a production environment.
ng serve. To get the application running, the ng serve command must execute within the [name-of-app] folder. Anywhere within the folder will do.
Try using ctrl + c twice to get the prompt for terminating the batch job. If you cannot see the "ng serve" command running, then you can do the following on Mac OSX (This should work on any Linux and Uni software as well).
In your browser, open http://localhost:4200/ to see the new application run. When you use the ng serve command to build an application and serve it locally, the server automatically rebuilds the application and reloads the page when you change any of the source files.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With