Home

Awesome

Angular AOT (Ahead Of Time) compilation with the Angular CLI Webpack plugin

Dependency Status devDependency Status

This repository shows how to use the Angular CLI Webpack plugin (@ngtools/webpack) to achieve AOT offline compilation.

It can also work with the new @utlimate/aot-loader package and has very similar configuration. See example in separate branch.

If you prefer the command line tool (ngc) provided by Angular, it can be found in a separate repository.

The application consists of a module (src/app/modules/main.module.ts) and a basic component (src/app/components/hello-world.component.ts) with template (src/app/components/hello-world.template.pug) and component specific style (src/app/components/hello-world.style.sass).

When the application starts (npm start) it generates the compiled files in memory and replaces the bootstrap logic to use the generated NgFactory files.

The application is bundled with Webpack from the main file and is available on http://localhost:9000.

Advantages

Disadvantages

Known issues

Further reading

Starters with AOT compilation available