Coder Social home page Coder Social logo

meego / angular2-aot-webpack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sonicoder86/angular2-aot-webpack

0.0 2.0 0.0 1.49 MB

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

Home Page: https://blacksonic.github.io/angular2-aot-webpack/

JavaScript 17.98% TypeScript 76.05% CSS 0.54% HTML 5.42%

angular2-aot-webpack's Introduction

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

Dependency Status devDependency Status

This repository shows how to use the Angular 2 command line offline compiler ngc with Webpack. Additionally it shows an alternative to ngc with @ngtools/webpack plugin used in the Angular CLI.

The application consists of a basic component (src/app/components/hello-world.component.ts) and a module (src/app/modules/main.module.ts).

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 non compiled(src/app/bootstrap.ts) and AOT compiled application(src/app/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 in src/index.html.

Starting the application

There are two modes for the application.

Using the command line tool ngc for compilation is the default one and can be started with npm start. It bundles once and watches for file changes with chokidar and re-runs the compilation on change.

The second one is using the @ngtools/webpack loader plugin for compilation and can be started with npm run start-plugin. It uses webpack-dev-server and live reloads on every file change.

Known issues

Further reading

Starters with AOT compilation available

angular2-aot-webpack's People

Contributors

greenkeeperio-bot avatar sonicoder86 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.