diff --git a/tasks/build/css.js b/tasks/build/css.js index f3e4f85943..ae10a48af6 100644 --- a/tasks/build/css.js +++ b/tasks/build/css.js @@ -134,10 +134,9 @@ function buildCSS(src, type, config, opts, callback) { } if (globs.individuals !== undefined && typeof src === 'string') { - const individuals = config.globs.individuals.replace(/\{/g,''); - const components = config.globs.components.replace(/\}/g,',').concat(individuals); + const components = config.globs.components.replace(/[{}]/g,'') + ',' + config.globs.individuals.replace(/[{}]/g,''); - src = config.paths.source.definitions + '/**/' + components + '.less'; + src = config.paths.source.definitions + '/**/{' + components + '}.less'; } const buildUncompressed = () => build(src, type, false, config, opts); diff --git a/tasks/build/javascript.js b/tasks/build/javascript.js index 4e47c109c8..af5d81ccae 100644 --- a/tasks/build/javascript.js +++ b/tasks/build/javascript.js @@ -101,10 +101,9 @@ function buildJS(src, type, config, callback) { } if (globs.individuals !== undefined && typeof src === 'string') { - const individuals = config.globs.individuals.replace(/\{/g,''); - const components = config.globs.components.replace(/\}/g,',').concat(individuals); + const components = config.globs.components.replace(/[{}]/g,'') + ',' + config.globs.individuals.replace(/[{}]/g,''); - src = config.paths.source.definitions + '/**/' + components + (config.globs.ignored || '') + '.js'; + src = config.paths.source.definitions + '/**/{' + components + '}' + (config.globs.ignored || '') + '.js'; } // copy source javascript diff --git a/tasks/config/project/config.js b/tasks/config/project/config.js index 62c4b8092d..eaf3fabee3 100644 --- a/tasks/config/project/config.js +++ b/tasks/config/project/config.js @@ -138,10 +138,10 @@ module.exports = { const componentsExceptIndividuals = components.filter((component) => !individuals.includes(component)); // takes component object and creates file glob matching selected components - config.globs.components = '{' + componentsExceptIndividuals.join(',') + '}'; + config.globs.components = componentsExceptIndividuals.length === 1 ? componentsExceptIndividuals[0] : '{' + componentsExceptIndividuals.join(',') + '}'; // components that should be built, but excluded from main .css/.js files - config.globs.individuals = (individuals.length >= 1) + config.globs.individuals = individuals.length === 1 ? individuals[0] : (individuals.length > 1) ? '{' + individuals.join(',') + '}' : undefined ;