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:
parent
c4270e4768
commit
2993055bed
3 changed files with 7 additions and 0 deletions
5
.changeset/eleven-olives-train.md
Normal file
5
.changeset/eleven-olives-train.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'astro': minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Adds support for an `--outDir` CLI flag to `astro build`
|
|
@ -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.'],
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -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,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue