Skip to content

Angular 2 AOT (Ahead Of Time) offline compilation example with Webpack

Notifications You must be signed in to change notification settings

qvazzler/angular2-aot-webpack

 
 

Repository files navigation

Angular 2 AOT (Ahead Of Time) offline compilation example with Webpack

devDependency Status

This repository shows how to use the Angular 2 (final) command line offline compiler (ngc) with Webpack.

The application consists of a simple component(app/hello-world.component.ts) and a module(app/main.ts) which is bootstrapped.

When the application starts(npm start or npm run start-prod for production) it generates the compiled files next to the module and the component(*.ngfactory.ts),

There is a different entry point for the non compiled(app/bootstrap.ts) and AOT compiled application(bootstrap.aot.ts).

The difference between the development and production version is minification with UglifyJS. Both development and production builds create the AOT compiled files.

The application is bundled with Webpack from the bootstrap files and is available on http://localhost:9000. You can change between the different builds with commenting/uncommenting entry files from index.html.

Further reading

If you wanna see Typescript tree-shaking in details check out this repository.

About

Angular 2 AOT (Ahead Of Time) offline compilation example with Webpack

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 81.4%
  • JavaScript 15.2%
  • HTML 3.4%