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, },