docs(quickstart): update guide systemjs.config.js

closes #1542
This commit is contained in:
Foxandxss 2016-05-29 00:12:43 +02:00 committed by Ward Bell
parent f9211fde33
commit 0047919e2d
2 changed files with 16 additions and 4 deletions

View File

@ -18,7 +18,7 @@
var packages = { var packages = {
'app': { main: 'main.js', defaultExtension: 'js' }, 'app': { main: 'main.js', defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' }, 'rxjs': { defaultExtension: 'js' },
'angular2-in-memory-web-api': { defaultExtension: 'js' }, 'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
}; };
var ngPackageNames = [ var ngPackageNames = [
@ -33,10 +33,21 @@
'upgrade', 'upgrade',
]; ];
// Add package entries for angular packages // Individual files (~300 requests):
ngPackageNames.forEach(function(pkgName) { function packIndex(pkgName) {
packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' };
}
// Bundled (~40 requests):
function packUmd(pkgName) {
packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' }; packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' };
}); };
// Most environments should use UMD; some (Karma) need the individual index files
var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;
// Add package entries for angular packages
ngPackageNames.forEach(setPackageConfig);
var config = { var config = {
map: map, map: map,

View File

@ -42,6 +42,7 @@
packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' }; packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' };
}; };
// Most environments should use UMD; some (Karma) need the individual index files
var setPackageConfig = System.packageWithIndex ? packIndex : packUmd; var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;
// Add package entries for angular packages // Add package entries for angular packages