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
+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