Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for an --outDir CLI flag to astro build #8808

Merged
merged 5 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/eleven-olives-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': minor
---

Adds support for an `--outDir` CLI flag to `astro build`
1 change: 1 addition & 0 deletions packages/astro/src/cli/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.'],
],
},
Expand Down
1 change: 1 addition & 0 deletions packages/astro/src/cli/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down