Skip to content

Commit

Permalink
[FEATURE] buildThemes: Add "compress" option
Browse files Browse the repository at this point in the history
  • Loading branch information
matz3 committed Oct 30, 2019
1 parent baa0f63 commit 3711c2f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/tasks/buildThemes.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ const fsInterface = require("@ui5/fs").fsInterface;
* @param {module:@ui5/fs.DuplexCollection} parameters.workspace DuplexCollection to read and write files
* @param {module:@ui5/fs.AbstractReader} parameters.dependencies Reader or Collection to read dependency files
* @param {Object} parameters.options Options
* @param {string} parameters.options.pattern Pattern to locate the files to be processed
* @param {string} parameters.options.projectName Project name
* @param {string} parameters.options.inputPattern Search pattern for *.less files to be built
* @param {string} [parameters.options.librariesPattern] Search pattern for .library files
* @param {boolean} [parameters.options.compress=true]
* @returns {Promise<undefined>} Promise resolving with <code>undefined</code> once data has been written
*/
module.exports = function({workspace, dependencies, options}) {
Expand All @@ -27,6 +30,8 @@ module.exports = function({workspace, dependencies, options}) {
promises.push(combo.byGlob(options.librariesPattern));
}

const compress = typeof options.compress !== "undefined" ? options.compress : true;

return Promise.all(promises).then(([allResources, availableLibraries]) => {
if (!availableLibraries || availableLibraries.length === 0) {
// Try to build all themes
Expand Down Expand Up @@ -55,7 +60,7 @@ module.exports = function({workspace, dependencies, options}) {
resources,
fs: fsInterface(combo),
options: {
compress: true
compress
}
});
}).then((processedResources) => {
Expand Down

0 comments on commit 3711c2f

Please sign in to comment.