Add minify option to backend:build

Co-authored-by: Ainhoa Larumbe <ainhoal@spotify.com>
Signed-off-by: Vincenzo Scamporlino <me@vinzscam.dev>
This commit is contained in:
Vincenzo Scamporlino
2021-12-02 10:53:36 +01:00
parent 3edae6a3e8
commit 1a1756d538
4 changed files with 7 additions and 2 deletions
+2 -1
View File
@@ -2,8 +2,9 @@
'@backstage/cli': patch
---
Add cli option to minify the generated code of a plugin
Add cli option to minify the generated code of a plugin or backend package
```
backstage-cli plugin:build --minify
backstage-cli backend:build --minify
```
+1
View File
@@ -165,6 +165,7 @@ common example being the `migrations` directory.
Usage: backstage-cli backend:build [options]
Options:
--minify Minify the generated code
-h, --help display help for command
```
+3 -1
View File
@@ -14,10 +14,12 @@
* limitations under the License.
*/
import { Command } from 'commander';
import { buildPackage, Output } from '../../lib/builder';
export default async () => {
export default async (cmd: Command) => {
await buildPackage({
outputs: new Set([Output.cjs, Output.types]),
minify: cmd.minify,
});
};
+1
View File
@@ -44,6 +44,7 @@ export function registerCommands(program: CommanderStatic) {
program
.command('backend:build')
.description('Build a backend plugin')
.option('--minify', 'Minify the generated code')
.action(lazy(() => import('./backend/build').then(m => m.default)));
program