docs: SystemJS to use @angular umd bundles
This commit is contained in:
parent
a595eb81ef
commit
31fe01e01f
@ -1,12 +1,16 @@
|
|||||||
// #docregion
|
/**
|
||||||
|
* System configuration for Angular 2 samples
|
||||||
|
* Adjust as necessary for your application needs.
|
||||||
|
*/
|
||||||
(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
|
||||||
@ -16,22 +20,21 @@
|
|||||||
'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',
|
'router',
|
||||||
'@angular/router-deprecated',
|
'router-deprecated',
|
||||||
'@angular/testing',
|
'upgrade',
|
||||||
'@angular/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' };
|
packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' };
|
||||||
});
|
});
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
|
@ -7,9 +7,10 @@
|
|||||||
// 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
|
||||||
@ -19,21 +20,26 @@
|
|||||||
'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',
|
'router',
|
||||||
'@angular/router-deprecated',
|
'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 = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user