Skip to content
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

[Build] Allow individual components to be defined in config #1385

Merged
merged 1 commit into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions tasks/build/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ function buildCSS(src, type, config, opts, callback) {
src = config.paths.source.definitions + '/**/' + config.globs.components + '.less';
}

if (globs.individuals !== undefined) {
const individuals = config.globs.individuals.replace('{','');
const components = config.globs.components.replace('}',',').concat(individuals);

src = config.paths.source.definitions + '/**/' + components + '.less';
}

const buildUncompressed = () => build(src, type, false, config, opts);
buildUncompressed.displayName = 'Building uncompressed CSS';

Expand Down
7 changes: 7 additions & 0 deletions tasks/build/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ function buildJS(src, type, config, callback) {
src = config.paths.source.definitions + '/**/' + config.globs.components + (config.globs.ignored || '') + '.js';
}

if (globs.individuals !== undefined) {
const individuals = config.globs.individuals.replace('{','');
const components = config.globs.components.replace('}',',').concat(individuals);

src = config.paths.source.definitions + '/**/' + components + (config.globs.ignored || '') + '.js';
}

// copy source javascript
const js = () => build(src, type, config);
js.displayName = "Building un/compressed Javascript";
Expand Down
8 changes: 8 additions & 0 deletions tasks/config/project/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ module.exports = {
: '{' + defaults.components.join(',') + '}'
;

// components that should be built, but excluded from main .css/.js files
config.globs.individuals = (typeof config.individuals == 'object')
? (config.individuals.length > 1)
? '{' + config.individuals.join(',') + '}'
: config.individuals[0]
: undefined
;

return config;

}
Expand Down