Add minify option to build command

Signed-off-by: Vincenzo Scamporlino <me@vinzscam.dev>
This commit is contained in:
Vincenzo Scamporlino
2021-12-27 16:25:20 +01:00
parent ae8f194508
commit 6e4080d31b
4 changed files with 9 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Add option to build command for minifying the generated code
+2 -1
View File
@@ -434,7 +434,8 @@ Usage: backstage-cli build [options]
Options:
--outputs &lt;formats&gt; List of formats to output [types,cjs,esm]
-h, --help display help for command
--minify Minify the generated code
-h, --help display help for command
```
## lint
+1 -1
View File
@@ -33,5 +33,5 @@ export default async (cmd: Command) => {
outputs = new Set([Output.types, Output.esm, Output.cjs]);
}
await buildPackage({ outputs });
await buildPackage({ outputs, minify: cmd.minify });
};
+1
View File
@@ -138,6 +138,7 @@ export function registerCommands(program: CommanderStatic) {
.command('build')
.description('Build a package for publishing')
.option('--outputs <formats>', 'List of formats to output [types,cjs,esm]')
.option('--minify', 'Minify the generated code')
.action(lazy(() => import('./build').then(m => m.default)));
program