From the course: Learning the Angular CLI
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Configuring different build options - Angular Tutorial
From the course: Learning the Angular CLI
Configuring different build options
- [Narrator] It is important to know that by default, the JavaScript bundles are not optimized. What I mean by that is that they are not minified nor uglified for performance. Also, the bundle names do not contain a hash for cache busting. By default, ng build runs a development build. Let's run a production build. And we can do that by using ng build --configuration=production. The dist directory is discarded and it is running a fresh build. Once that is complete, let's take a look again at the dist folder. In this case, we now see that the source maps were not generated, and the bundle filenames include a hash for cache busting. Also, they have been minified and uglified, thus significantly reducing the file size of these bundles. If you'd like to generate source maps in a production build, you can use a new flag: ng build --configuration=production - -source-map. In order to see what this production…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.