diff --git a/src/commands/app/build.js b/src/commands/app/build.js index a5e67657..27d49f3e 100644 --- a/src/commands/app/build.js +++ b/src/commands/app/build.js @@ -114,7 +114,7 @@ class Build extends BaseCommand { const bundleOptions = { shouldDisableCache: true, shouldContentHash: flags['content-hash'], - shouldOptimize: false, + shouldOptimize: flags['web-optimize'], logLevel: flags.verbose ? 'verbose' : 'warn' } const bundler = await bundle(entryFile, config.web.distProd, bundleOptions, onProgress) @@ -180,6 +180,10 @@ Build.flags = { default: true, allowNo: true }), + 'web-optimize': flags.boolean({ + description: '[default: false] Enable optimization (minification) of js/css/html', + default: false + }), extension: flags.string({ description: 'Build only a specific extension point, the flags can be specified multiple times', exclusive: ['action'], diff --git a/src/commands/app/deploy.js b/src/commands/app/deploy.js index f5c4cd62..da4cbb92 100644 --- a/src/commands/app/deploy.js +++ b/src/commands/app/deploy.js @@ -296,6 +296,10 @@ Deploy.flags = { description: 'Force publish extension(s) to Exchange, delete previously published extension points', default: false, exclusive: ['action', 'publish'] // no-publish is excluded + }), + 'web-optimize': flags.boolean({ + description: '[default: false] Enable optimization (minification) of web js/css/html', + default: false }) }