What is the difference between ng serve and ng build?

Angular basics · Freshers

Model answer

ng serve starts a local development server with live reload: it rebuilds in memory when you save a file and is meant for development only. ng build writes the finished files to the dist folder, optimised and minified when you use the production configuration, ready to be deployed to a web server.

You never deploy the output of ng serve. You deploy the dist folder produced by ng build.

Learn this topic

Angular Tutorial: Beginner to Advanced .

Sign in to add your own answer.

More questions