0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-24 22:46:02 -05:00

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>
This commit is contained in:
Chris Swithinbank 2023-10-11 18:26:12 +02:00 committed by GitHub
parent c4270e4768
commit 2993055bed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
'astro': minor
---
Adds support for an `--outDir` CLI flag to `astro build`

View file

@ -15,6 +15,7 @@ export async function build({ flags }: BuildOptions) {
tables: { tables: {
Flags: [ Flags: [
['--drafts', `Include Markdown draft pages in the build.`], ['--drafts', `Include Markdown draft pages in the build.`],
['--outDir <directory>', `Specify the output directory for the build.`],
['--help (-h)', 'See all available flags.'], ['--help (-h)', 'See all available flags.'],
], ],
}, },

View file

@ -14,6 +14,7 @@ export function flagsToAstroInlineConfig(flags: Flags): AstroInlineConfig {
root: typeof flags.root === 'string' ? flags.root : undefined, root: typeof flags.root === 'string' ? flags.root : undefined,
site: typeof flags.site === 'string' ? flags.site : undefined, site: typeof flags.site === 'string' ? flags.site : undefined,
base: typeof flags.base === 'string' ? flags.base : undefined, base: typeof flags.base === 'string' ? flags.base : undefined,
outDir: typeof flags.outDir === 'string' ? flags.outDir : undefined,
markdown: { markdown: {
drafts: typeof flags.drafts === 'boolean' ? flags.drafts : undefined, drafts: typeof flags.drafts === 'boolean' ? flags.drafts : undefined,
}, },