What are the options set by default when we run ng build --prod

4.3k views Asked by At

When I build my angular application with ng build --prod it creates a build for production environment with build optimization, tree-shaking etc.. If I want to make the same kind of build for development environment, what options needs to be passed with ng build command? Eg.,

ng build --configuration=development --aot --buildOptimizer=true --vendorChunk=false

Basically, what are the cli options one should pass, to make a dev build exactly similar to prod build(except the configuration)?

1

There are 1 answers

0
Francesco On BEST ANSWER

Other than the option you already used you should add:

--outputHashing= all --sourceMap= false --extractCss=true --namedChunks= false --extractLicenses=true --optimization=true

You can find here the list of all available options.

If you check your angular.json file, under:

"configurations": {
  "production": {
   // HERE all the used options by default for prod build
   }
}

You can read all the used options for a prod build.