0

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)?

R. Richards
  • 24,603
  • 10
  • 64
  • 64
JPS
  • 2,730
  • 5
  • 32
  • 54
  • you can choose your environment mode using `--configuration` so, why do you want to remove it. – Developer Dec 03 '19 at 13:16
  • 1
    I think that will depend what's in your `angular.json`, you can create a new configuration with the same settings – C.OG Dec 03 '19 at 13:17

1 Answers1

2

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.

Francesco
  • 9,947
  • 7
  • 67
  • 110