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:
@@ -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
|
||||
```
|
||||
|
||||
@@ -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
|
||||
```
|
||||
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user