• Stars
    star
    313
  • Rank 133,714 (Top 3 %)
  • Language
    JavaScript
  • Created over 8 years ago
  • Updated about 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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

Dependency Status devDependency Status

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

If you prefer the Webpack plugin provided by the Angular CLI, 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.html) and component specific style (src/app/components/hello-world.style.css).

When the application starts (npm start) it generates the compiled files next to the modules and the components(*.ngfactory.ts).

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

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

Advantages

  • Can always be used with the newest version of Angular
  • Can output separate compiled files for AOT compatible package publishing

Disadvantages

  • Works only with HTML and CSS, other file types need a previous build step
  • No watch mode yet, must be done manually (bin/ngc-watch.js) and compiles all the files
  • Need to maintain AOT version of bootstrap file
  • Needs cleanup step before compiling

Known issues

Further reading

Starters with AOT compilation available

More Repositories

1

awesome-vue-3

A curated list of awesome things related to Vue 3
1,324
star
2

vue-3-playground

Vue 3 Playground packed with all the new features
Vue
509
star
3

angular2-babel-esnext-starter

Angular development and testing examples with Babel in Javascript (ES6/ES7).
JavaScript
488
star
4

babel-webpack-tree-shaking

Tree-shaking example with Babel and Webpack
JavaScript
252
star
5

typescript-webpack-tree-shaking

Tree-shaking example with Typescript and Webpack
JavaScript
145
star
6

angular2-esnext-todomvc

Angular TodoMVC application in Javascript (ES6/ES7).
JavaScript
130
star
7

todomvc-vue-composition-api

TodoMVC built with Vue 3 Composition Api and Vuex
JavaScript
126
star
8

movie-search-vue

Movie search app with the Vue 3 Composition API
Vue
44
star
9

angular2-aot-cli-webpack-plugin

Angular AOT (Ahead Of Time) compilation with Webpack plugin
JavaScript
40
star
10

todomvc-svelte

TodoMVC built with Svelte and Store
JavaScript
38
star
11

todomvc-vue

TodoMVC built with Vue and Vuex
JavaScript
28
star
12

todomvc-react-hooks

TodoMVC built with React Hooks and Redux
JavaScript
24
star
13

ngx-http-test

Angular 2 Http test helper
TypeScript
17
star
14

minesweeper

Minesweeper game built with isomorphic Javascript
JavaScript
14
star
15

todomvc-react

TodoMVC built with React and Redux
JavaScript
6
star
16

node-docker-workflow

Docker workflow for local development and deployment
Makefile
5
star
17

game-of-life

Vue 3 implementation of Conway's Game of Life, with a twist
Vue
4
star
18

todomvc-angular

TodoMVC built with Angular and NgRx
TypeScript
3
star
19

webpack-showcase

Basic setup for Webpack 4 and Babel 7 covering development, testing and deployment.
JavaScript
3
star
20

url-shortener

TypeScript
1
star
21

framework-diff

Comparing the same application written in (Vue, Angular, React, Svelte)
Vue
1
star