When I run ng serve
, where are the files generated and stored? I need to troubleshoot why the app works with ng serve
but not for production build.
Forgot to mention that I'm using webpack version of angular-cli.
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.
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.
The ng build command is intentionally for building the apps and deploying the build artifacts. The command does not generate an output folder. The output folder is – dist/. The ng serve builds artifacts from memory instead for a faster development experience.
From the docs: The CLI supports running a live browser reload experience to users by running ng serve. This will compile the application upon file saves and reload the browser with the newly compiled application. This is done by hosting the application in memory and serving it via webpack-dev-server.
With the webpack version the output isn't written to disk. Webpack manages that all in memory and serves it to the browser using the webpack-dev-server
.
If you'd like to view the dev output, you will need to run ng build
and then look into the dist
directory
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