From af446863b65ce21c382f529fd01678d20e881490 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Wed, 23 Aug 2023 01:38:56 +0200 Subject: [PATCH] feat(cli): support `--preset` and `--minify`/`--no-minify` args for `build` --- src/cli/commands/build.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/cli/commands/build.ts b/src/cli/commands/build.ts index db75721187..ff8ec7135f 100644 --- a/src/cli/commands/build.ts +++ b/src/cli/commands/build.ts @@ -12,12 +12,25 @@ export default defineCommand({ }, args: { ...commonArgs, + minify: { + type: "boolean", + description: + "Minify the output (overides preset defaults you can also use `--no-minify` to disable).", + }, + preset: { + type: "string", + description: + "The build preset to use (you can also use `NITRO_PRESET` environment variable).", + }, }, async run({ args }) { const rootDir = resolve((args.dir || args._dir || ".") as string); + console.log(args.minify); const nitro = await createNitro({ rootDir, dev: false, + minify: args.minify, + preset: args.preset, }); await prepare(nitro); await copyPublicAssets(nitro);