Skip to content

Commit

Permalink
feat: add --[no-]web-optimize flag (#479)
Browse files Browse the repository at this point in the history
* remove allowNo from web-optimize flag - default is false
* support the --web-optimize flag from the deploy command also
  • Loading branch information
purplecabbage authored Sep 28, 2021
1 parent d03a726 commit 41bf258
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/commands/app/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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'],
Expand Down
4 changes: 4 additions & 0 deletions src/commands/app/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
}

Expand Down

0 comments on commit 41bf258

Please sign in to comment.