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