Resolve Angular 2 Routes for Webpack Context creation


stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
62Aug 7, 2016Aug 1, 2016Minified + gzip package size for @angularclass/resolve-angular-routes in KB


Angular 2 Fundamentals


Resolve Angular 2 Routes for Context

npm install --save-dev @angularclass/resolve-angular-routes

 |    └──index.ts  // NgModule or Component with either
 └──index.ts // routes

// the router resolve will look for these static properties
// 'routes', 'ROUTER_CONFIG', or 'ROUTE_CONFIG'

// ngRoutes from index.ts
  { path: 'about', component: './about' }

// context map created
  './about': './app/about'
import 'core-js/es6';
import 'core-js/es7/reflect';

const resolveNgRoute = require('@angularclass/resolve-angular-routes');

module.exports = {
  // etc
  plugins: [
    new ContextReplacementPlugin(
      root('./src'), // root() __dirname helper
  // etc

enjoy — AngularClass

AngularClass ##AngularClass

Learn AngularJS, Angular 2, and Modern Web Development from the best. Looking for corporate Angular training, want to host us, or Angular consulting? patrick@angularclass.com


If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.