|
| 1 | +/*********************************************************************************************** |
| 2 | + * User Configuration. |
| 3 | + **********************************************************************************************/ |
| 4 | +/** Map relative paths to URLs. */ |
| 5 | +const map: any = { |
| 6 | +}; |
| 7 | + |
| 8 | +/** User packages configuration. */ |
| 9 | +const packages: any = { |
| 10 | +}; |
| 11 | + |
| 12 | +//////////////////////////////////////////////////////////////////////////////////////////////// |
| 13 | +/*********************************************************************************************** |
| 14 | + * Everything underneath this line is managed by the CLI. |
| 15 | + **********************************************************************************************/ |
| 16 | +const barrels: string[] = [ |
| 17 | + // Angular specific barrels. |
| 18 | + '@angular/core', |
| 19 | + '@angular/common', |
| 20 | + '@angular/compiler', |
| 21 | + '@angular/http', |
| 22 | + '@angular/router', |
| 23 | + '@angular/platform-browser', |
| 24 | + '@angular/platform-browser-dynamic', |
| 25 | + |
| 26 | + // Thirdparty barrels. |
| 27 | + 'rxjs', |
| 28 | + |
| 29 | + // App specific barrels. |
| 30 | + 'app', |
| 31 | + 'app/shared', |
| 32 | + /** @cli-barrel */ |
| 33 | +]; |
| 34 | + |
| 35 | +const cliSystemConfigPackages: any = {}; |
| 36 | +barrels.forEach((barrelName: string) => { |
| 37 | + cliSystemConfigPackages[barrelName] = { main: 'index' }; |
| 38 | +}); |
| 39 | + |
| 40 | +/** Type declaration for ambient System. */ |
| 41 | +declare var System: any; |
| 42 | + |
| 43 | +// Apply the CLI SystemJS configuration. |
| 44 | +System.config({ |
| 45 | + map: { |
| 46 | + '@angular': 'vendor/@angular', |
| 47 | + 'rxjs': 'vendor/rxjs', |
| 48 | + 'main': 'main.js' |
| 49 | + }, |
| 50 | + packages: cliSystemConfigPackages |
| 51 | +}); |
| 52 | + |
| 53 | +// Apply the user's configuration. |
| 54 | +System.config({ map, packages }); |
0 commit comments