npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular2-aot-webpack

v1.0.0

Published

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

Downloads

38

Readme

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