Building Build your app via CLI

Creating a build

The build artifacts will be stored in the dist/ directory.

ng build

Building for production

Adding the prod flag to ng build will set the build target and environment to production, which will optimize the build.

ng build --configuration production

Ahead-of-time Compilation

When building for production, add the aot flag to enable the Ahead-Of-Time compiler. This will pre-compile Angular modules into native Javascript the browser can easily interpret instead of bundling the Angular compiler within the application and compiling everything in the browser. This will result in faster rendering, fewer asynchronous requests, smaller Angular framework size, and better security for your application.

ng build --configuration production --aot