Created
June 27, 2016 06:56
-
-
Save tkssharma/7b690dcc35154ea26b06b84dd6a9ce8b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(global) { | |
// map tells the System loader where to look for things | |
var map = { | |
'app': 'app', // 'dist', | |
'@angular': 'node_modules/@angular', | |
'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api', | |
'rxjs': 'node_modules/rxjs' | |
}; | |
// packages tells the System loader how to load when no filename and/or no extension | |
var packages = { | |
'app': { main: 'boot.js', defaultExtension: 'js' }, | |
'rxjs': { defaultExtension: 'js' }, | |
'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' }, | |
}; | |
var ngPackageNames = [ | |
'common', | |
'compiler', | |
'core', | |
'http', | |
'platform-browser', | |
'platform-browser-dynamic', | |
'router', | |
'router-deprecated', | |
'upgrade', | |
]; | |
// Individual files (~300 requests): | |
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' }; | |
}; | |
var setPackageConfig = System.packageWithIndex ? packIndex : packUmd; | |
// Add package entries for angular packages | |
ngPackageNames.forEach(setPackageConfig); | |
var config = { | |
map: map, | |
packages: packages | |
} | |
System.config(config); | |
})(this); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment