Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 31fe01e

Browse files
committed
docs: SystemJS to use @angular umd bundles
1 parent a595eb8 commit 31fe01e

File tree

2 files changed

+41
-32
lines changed

2 files changed

+41
-32
lines changed

public/docs/_examples/quickstart/ts/systemjs.config.1.js

+20-17
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
// #docregion
1+
/**
2+
* System configuration for Angular 2 samples
3+
* Adjust as necessary for your application needs.
4+
*/
25
(function(global) {
36

47
// map tells the System loader where to look for things
58
var map = {
69
'app': 'app', // 'dist',
7-
'rxjs': 'node_modules/rxjs',
10+
11+
'@angular': 'node_modules/@angular',
812
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
9-
'@angular': 'node_modules/@angular'
13+
'rxjs': 'node_modules/rxjs'
1014
};
1115

1216
// packages tells the System loader how to load when no filename and/or no extension
@@ -16,22 +20,21 @@
1620
'angular2-in-memory-web-api': { defaultExtension: 'js' },
1721
};
1822

19-
var packageNames = [
20-
'@angular/common',
21-
'@angular/compiler',
22-
'@angular/core',
23-
'@angular/http',
24-
'@angular/platform-browser',
25-
'@angular/platform-browser-dynamic',
26-
'@angular/router',
27-
'@angular/router-deprecated',
28-
'@angular/testing',
29-
'@angular/upgrade',
23+
var ngPackageNames = [
24+
'common',
25+
'compiler',
26+
'core',
27+
'http',
28+
'platform-browser',
29+
'platform-browser-dynamic',
30+
'router',
31+
'router-deprecated',
32+
'upgrade',
3033
];
3134

32-
// add package entries for angular packages in the form '@angular/common': { main: 'index.js', defaultExtension: 'js' }
33-
packageNames.forEach(function(pkgName) {
34-
packages[pkgName] = { main: 'index.js', defaultExtension: 'js' };
35+
// Add package entries for angular packages
36+
ngPackageNames.forEach(function(pkgName) {
37+
packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' };
3538
});
3639

3740
var config = {

public/docs/_examples/systemjs.config.js

+21-15
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
// map tells the System loader where to look for things
88
var map = {
99
'app': 'app', // 'dist',
10-
'rxjs': 'node_modules/rxjs',
10+
11+
'@angular': 'node_modules/@angular',
1112
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
12-
'@angular': 'node_modules/@angular'
13+
'rxjs': 'node_modules/rxjs'
1314
};
1415

1516
// packages tells the System loader how to load when no filename and/or no extension
@@ -19,21 +20,26 @@
1920
'angular2-in-memory-web-api': { defaultExtension: 'js' },
2021
};
2122

22-
var packageNames = [
23-
'@angular/common',
24-
'@angular/compiler',
25-
'@angular/core',
26-
'@angular/http',
27-
'@angular/platform-browser',
28-
'@angular/platform-browser-dynamic',
29-
'@angular/router',
30-
'@angular/router-deprecated',
31-
'@angular/upgrade',
23+
var ngPackageNames = [
24+
'common',
25+
'compiler',
26+
'core',
27+
'http',
28+
'platform-browser',
29+
'platform-browser-dynamic',
30+
'router',
31+
'router-deprecated',
32+
'upgrade',
3233
];
3334

34-
// add package entries for angular packages in the form '@angular/common': { main: 'index.js', defaultExtension: 'js' }
35-
packageNames.forEach(function(pkgName) {
36-
packages[pkgName] = { main: 'index.js', defaultExtension: 'js' };
35+
// Add package entries for angular packages
36+
ngPackageNames.forEach(function(pkgName) {
37+
38+
// Bundled (~40 requests):
39+
packages['@angular/'+pkgName] = { main: pkgName + '.umd.js', defaultExtension: 'js' };
40+
41+
// Individual files (~300 requests):
42+
//packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' };
3743
});
3844

3945
var config = {

0 commit comments

Comments
 (0)