Skip to content

Commit

Permalink
feat(cli): support --preset and --minify/--no-minify args for `…
Browse files Browse the repository at this point in the history
…build` (#1621)
  • Loading branch information
pi0 authored Aug 22, 2023
1 parent c431b71 commit d784987
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/cli/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d784987

Please sign in to comment.