Difference from Angular Production and Development Build

Asked

Viewed 630 times

4

I would like to know the differences between the build of production and the build development in Angular?

1 answer

10


Developing

ng build 

or

ng build --dev
  • "maps" files are generated, files with the .js.map extension
  • The code is not minified and uglification
  • It does not make a "Tree Shaking", where it is cleaned the "dead code"
  • There is no AOT compilation

Uses the Environment.ts file configuration

Production

ng build --prod 
  • No "maps" files are generated, files with extension .js.map
  • The code is minified and uglification
  • Do a "Tree Shaking" where the "dead code" is cleared"
  • There is AOT compilation

Uses Environment.prod.ts file configuration

Uglification - Put short names for variables

Minificado - White space removal process, comments and any unnecessary code for the machine to interpret

Tree Shaking - Process to remove any code that has no usefulness to the application

Sources

Angular Dev Build vs Prod Build

Tree Shaking

AOT

How to Manage Different Environments with Angular CLI?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.