Skip to content

(feat) reduced complexity when adding n additional packages #1593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Nov 7, 2016
26 changes: 26 additions & 0 deletions tools/config/project.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { join } from 'path';

import { SeedConfig } from './seed.config';
// import { ExtendPackages } from './seed.config.interfaces';

/**
* This class extends the basic seed configuration, allowing for project specific overrides. A few examples can be found
Expand Down Expand Up @@ -31,6 +32,31 @@ export class ProjectConfig extends SeedConfig {
// {src: `${this.CSS_SRC}/path-to-lib/test-lib.css`, inject: true, vendor: false},
];

// Add packages (e.g. lodash)
// let additionalPackages: ExtendPackages[] = [{
// name: 'lodash',
// path: `${this.APP_BASE}node_modules/lodash/lodash.js`,
// packageMeta: {
// main: 'index.js',
// defaultExtension: 'js'
// }
// }];
//
// or
//
// let additionalPackages: ExtendPackages[] = [];
//
// additionalPackages.push({
// name: 'lodash',
// path: `${this.APP_BASE}node_modules/lodash/lodash.js`,
// packageMeta: {
// main: 'index.js',
// defaultExtension: 'js'
// }
// });
//
// this.addPackagesBundles(additionalPackages);

/* Add to or override NPM module configurations: */
// this.mergeObject(this.PLUGIN_CONFIGS['browser-sync'], { ghostMode: false });
}
Expand Down
9 changes: 8 additions & 1 deletion tools/config/seed.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,14 @@ export class SeedConfig {
}
}

addPackagesBundles(packs: ExtendPackages[]) {

packs.forEach((pack: ExtendPackages) => {
this.addPackageBundles(pack);
});

}

}

/**
Expand Down Expand Up @@ -626,4 +634,3 @@ function getBuildType() {
return BUILD_TYPES.DEVELOPMENT;
}
}