From 2993055bed2764c31ff4b4f55b81ab6b1ae6b401 Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Wed, 11 Oct 2023 18:26:12 +0200 Subject: [PATCH] Add support for an `--outDir` CLI flag to `astro build` (#8808) * Add support for an `--outDir` CLI flag to `astro build` * Add changeset * Update .changeset/eleven-olives-train.md Co-authored-by: Sarah Rainsberger --------- Co-authored-by: Nate Moore Co-authored-by: Sarah Rainsberger --- .changeset/eleven-olives-train.md | 5 +++++ packages/astro/src/cli/build/index.ts | 1 + packages/astro/src/cli/flags.ts | 1 + 3 files changed, 7 insertions(+) create mode 100644 .changeset/eleven-olives-train.md diff --git a/.changeset/eleven-olives-train.md b/.changeset/eleven-olives-train.md new file mode 100644 index 000000000000..4f393068aff2 --- /dev/null +++ b/.changeset/eleven-olives-train.md @@ -0,0 +1,5 @@ +--- +'astro': minor +--- + +Adds support for an `--outDir` CLI flag to `astro build` diff --git a/packages/astro/src/cli/build/index.ts b/packages/astro/src/cli/build/index.ts index dd44823d1427..8919dfc40976 100644 --- a/packages/astro/src/cli/build/index.ts +++ b/packages/astro/src/cli/build/index.ts @@ -15,6 +15,7 @@ export async function build({ flags }: BuildOptions) { tables: { Flags: [ ['--drafts', `Include Markdown draft pages in the build.`], + ['--outDir ', `Specify the output directory for the build.`], ['--help (-h)', 'See all available flags.'], ], }, diff --git a/packages/astro/src/cli/flags.ts b/packages/astro/src/cli/flags.ts index 54177e998585..c97f1801acf1 100644 --- a/packages/astro/src/cli/flags.ts +++ b/packages/astro/src/cli/flags.ts @@ -14,6 +14,7 @@ export function flagsToAstroInlineConfig(flags: Flags): AstroInlineConfig { root: typeof flags.root === 'string' ? flags.root : undefined, site: typeof flags.site === 'string' ? flags.site : undefined, base: typeof flags.base === 'string' ? flags.base : undefined, + outDir: typeof flags.outDir === 'string' ? flags.outDir : undefined, markdown: { drafts: typeof flags.drafts === 'boolean' ? flags.drafts : undefined, },