feat(cli): allow overriding minify flag with build repo command

Signed-off-by: Heikki Hellgren <heikki.hellgren@op.fi>
This commit is contained in:
Heikki Hellgren
2024-09-11 09:56:30 +03:00
parent f094dfd54a
commit d10f6b6111
4 changed files with 13 additions and 3 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Allow overriding minify flag with build repo command
+1
View File
@@ -424,6 +424,7 @@ Usage: backstage-cli repo build [options]
Options:
--all
--since <ref>
--minify
-h, --help
```
+4
View File
@@ -50,6 +50,10 @@ export function registerRepoCommand(program: Command) {
'--since <ref>',
'Only build packages and their dev dependents that changed since the specified ref',
)
.option(
'--minify',
'Minify the generated code. Does not apply to app package (app is minified by default).',
)
.action(lazy(() => import('./repo/build').then(m => m.command)));
command
+3 -3
View File
@@ -20,8 +20,8 @@ import { relative as relativePath } from 'path';
import { buildPackages, getOutputsForRole } from '../../lib/builder';
import { paths } from '../../lib/paths';
import {
PackageGraph,
BackstagePackage,
PackageGraph,
PackageRoles,
} from '@backstage/cli-node';
import { runParallelWorkers } from '../../lib/parallel';
@@ -136,8 +136,8 @@ export async function command(opts: OptionValues, cmd: Command): Promise<void> {
packageJson: pkg.packageJson,
outputs,
logPrefix: `${chalk.cyan(relativePath(paths.targetRoot, pkg.dir))}: `,
minify: buildOptions.minify,
workspacePackages: packages,
minify: opts.minify ?? buildOptions.minify,
};
});
@@ -180,7 +180,7 @@ export async function command(opts: OptionValues, cmd: Command): Promise<void> {
await buildBackend({
targetDir: pkg.dir,
skipBuildDependencies: true,
minify: buildOptions.minify,
minify: opts.minify ?? buildOptions.minify,
});
},
});