Commit e8189ea5 authored by Ward Bell's avatar Ward Bell

chore: update system.js for umd bundles

parent 10fe34fe
/** /**
* System configuration for Angular 2 samples * System configuration for Angular 2 apps
* Adjust as necessary for your application needs. * Adjust as necessary for your application needs.
* Override at the last minute with global.filterSystemConfig (as plunkers do)
*/ */
(function(global) { (function(global) {
// map tells the System loader where to look for things // map tells the System loader where to look for things
var map = { var map = {
'app': 'app', // 'dist', 'app': 'app', // 'dist',
'rxjs': 'node_modules/rxjs',
'@angular': 'node_modules/@angular',
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api', 'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
'@angular': 'node_modules/@angular' 'rxjs': 'node_modules/rxjs'
}; };
// packages tells the System loader how to load when no filename and/or no extension // packages tells the System loader how to load when no filename and/or no extension
...@@ -20,27 +20,32 @@ ...@@ -20,27 +20,32 @@
'angular2-in-memory-web-api': { defaultExtension: 'js' }, 'angular2-in-memory-web-api': { defaultExtension: 'js' },
}; };
var packageNames = [ var ngPackageNames = [
'@angular/common', 'common',
'@angular/compiler', 'compiler',
'@angular/core', 'core',
'@angular/http', 'http',
'@angular/platform-browser', 'platform-browser',
'@angular/platform-browser-dynamic', 'platform-browser-dynamic',
'@angular/router-deprecated', 'router',
'@angular/testing', 'router-deprecated',
'@angular/upgrade', 'upgrade',
]; ];
// add package entries for angular packages in the form '@angular/common': { main: 'index.js', defaultExtension: 'js' } // Add package entries for angular packages
packageNames.forEach(function(pkgName) { ngPackageNames.forEach(function(pkgName) {
packages[pkgName] = { main: 'index.js', defaultExtension: 'js' };
// Bundled (~40 requests):
packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' };
// Individual files (~300 requests):
//packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' };
}); });
var config = { var config = {
map: map, map: map,
packages: packages packages: packages
}; }
System.config(config); System.config(config);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment