@@ -4,45 +4,37 @@ var isPublic = typeof window != "undefined";
44 * System configuration for Angular 2 samples
55 * Adjust as necessary for your application needs.
66 */
7- ( function ( global ) {
8- // map tells the System loader where to look for things
9- var map = {
10- 'app' : 'app' , // 'dist',
11- '@angular' : ( isPublic ) ? '@angular' : 'node_modules/@angular' ,
12- 'rxjs' : ( isPublic ) ? 'rxjs' : 'node_modules/rxjs' ,
13- } ;
14- // packages tells the System loader how to load when no filename and/or no extension
15- var packages = {
16- 'app' : { main : 'main.js' , defaultExtension : 'js' } ,
17- 'rxjs' : { defaultExtension : 'js' }
18- } ;
19- var ngPackageNames = [
20- 'common' ,
21- 'compiler' ,
22- 'core' ,
23- 'forms' ,
24- 'http' ,
25- 'platform-browser' ,
26- 'platform-browser-dynamic' ,
27- 'router' ,
28- 'router-deprecated' ,
29- 'upgrade' ,
30- ] ;
31- // Individual files (~300 requests):
32- function packIndex ( pkgName ) {
33- packages [ '@angular/' + pkgName ] = { main : 'index.js' , defaultExtension : 'js' } ;
34- }
35- // Bundled (~40 requests):
36- function packUmd ( pkgName ) {
37- packages [ '@angular/' + pkgName ] = { main : 'bundles/' + pkgName + '.umd.js' , defaultExtension : 'js' } ;
38- }
39- // Most environments should use UMD; some (Karma) need the individual index files
40- var setPackageConfig = System . packageWithIndex ? packIndex : packUmd ;
41- // Add package entries for angular packages
42- ngPackageNames . forEach ( setPackageConfig ) ;
43- var config = {
44- map : map ,
45- packages : packages
46- } ;
47- System . config ( config ) ;
48- } ) ( this ) ;
7+ ( function ( global ) {
8+ System . config ( {
9+ paths : {
10+ // paths serve as alias
11+ 'npm:' : ( isPublic ) ? 'node_modules/' : ''
12+ } ,
13+ // map tells the System loader where to look for things
14+ map : {
15+ // our app is within the app folder
16+ app : 'app' ,
17+ // angular bundles
18+ '@angular/core' : 'npm:@angular/core/bundles/core.umd.js' ,
19+ '@angular/common' : 'npm:@angular/common/bundles/common.umd.js' ,
20+ '@angular/compiler' : 'npm:@angular/compiler/bundles/compiler.umd.js' ,
21+ '@angular/platform-browser' : 'npm:@angular/platform-browser/bundles/platform-browser.umd.js' ,
22+ '@angular/platform-browser-dynamic' : 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js' ,
23+ '@angular/http' : 'npm:@angular/http/bundles/http.umd.js' ,
24+ '@angular/router' : 'npm:@angular/router/bundles/router.umd.js' ,
25+ '@angular/forms' : 'npm:@angular/forms/bundles/forms.umd.js' ,
26+ // other libraries
27+ 'rxjs' : 'npm:rxjs'
28+ } ,
29+ // packages tells the System loader how to load when no filename and/or no extension
30+ packages : {
31+ app : {
32+ main : './main.js' ,
33+ defaultExtension : 'js'
34+ } ,
35+ rxjs : {
36+ defaultExtension : 'js'
37+ }
38+ }
39+ } ) ;
40+ } ) ( this ) ;
0 commit comments