diff options
author | 2023-10-11 18:26:12 +0200 | |
---|---|---|
committer | 2023-10-11 18:26:12 +0200 | |
commit | 2993055bed2764c31ff4b4f55b81ab6b1ae6b401 (patch) | |
tree | 443410c8929bccf95ab8d3e5c2aad2483c55ce97 | |
parent | c4270e47681ee2453f3fea07fed7b238645fd6ea (diff) | |
download | astro-2993055bed2764c31ff4b4f55b81ab6b1ae6b401.tar.gz astro-2993055bed2764c31ff4b4f55b81ab6b1ae6b401.tar.zst astro-2993055bed2764c31ff4b4f55b81ab6b1ae6b401.zip |
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 <sarah@rainsberger.ca>
---------
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
-rw-r--r-- | .changeset/eleven-olives-train.md | 5 | ||||
-rw-r--r-- | packages/astro/src/cli/build/index.ts | 1 | ||||
-rw-r--r-- | packages/astro/src/cli/flags.ts | 1 |
3 files changed, 7 insertions, 0 deletions
diff --git a/.changeset/eleven-olives-train.md b/.changeset/eleven-olives-train.md new file mode 100644 index 000000000..4f393068a --- /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 dd44823d1..8919dfc40 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 <directory>', `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 54177e998..c97f1801a 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, }, |