Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are files stored when running ng serve?

Tags:

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.

like image 207
Sam Avatar asked Aug 31 '16 18:08

Sam


People also ask

What folder is NG serve in?

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.

What happens when Ng serve runs?

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.

Where is the output of build created with the execution of NG serve command saved?

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.

What happens on NG serve angular?

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.


1 Answers

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

like image 138
Brocco Avatar answered Sep 17 '22 14:09

Brocco