Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 27 additions & 17 deletions addon/ng2/blueprints/ng2/files/__path__/system-config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
/** Only use System here. */
declare var System: any;
/***********************************************************************************************
* User Configuration.
**********************************************************************************************/
/** Map relative paths to URLs. */
const map: any = {
};

/** User packages configuration. */
const packages: any = {
};

const barrels: string[] = [
////////////////////////////////////////////////////////////////////////////////////////////////
/***********************************************************************************************
* Everything underneath this line is managed by the CLI.
**********************************************************************************************/
const barrels = [
// Angular specific barrels.
'@angular/core',
'@angular/common',
Expand All @@ -11,6 +23,7 @@ const barrels: string[] = [
'@angular/platform-browser',
'@angular/platform-browser-dynamic',

// Thirdparty barrels.
'rxjs',

// App specific barrels.
Expand All @@ -19,26 +32,23 @@ const barrels: string[] = [
/** @cli-barrel */
];

const _cliSystemConfig = {};
barrels.forEach((barrelName: string) => {
_cliSystemConfig[barrelName] = { main: 'index' };
});

/** Type declaration for ambient System. */
declare var System: any;

// Angular CLI SystemJS configuration.
// Apply the CLI SystemJS configuration.
System.config({
map: {
'@angular': 'vendor/@angular',
'rxjs': 'vendor/rxjs',
'main': 'main.js'
},
packages: barrels.reduce((barrelConfig: any, barrelName: string) => {
barrelConfig[barrelName] = {
main: 'index'
};
return barrelConfig;
}, {})
packages: _cliSystemConfig
});


// Add your custom SystemJS configuration here.
System.config({
packages: {
// Add your custom SystemJS packages here.
}
});
// Apply the user's configuration.
System.config({ map, packages });