Skip to content

Commit

Permalink
fix: throw an error for incorrect configuration (#7680)
Browse files Browse the repository at this point in the history
Co-authored-by: Bjorn Lu <[email protected]>
  • Loading branch information
ematipico and bluwy committed Jul 17, 2023
1 parent c84e8b8 commit cc8e9de
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-weeks-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Throw an error when `build.split` is set to `true` but `output` isn't set to `"server"`.
8 changes: 8 additions & 0 deletions packages/astro/src/core/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,14 @@ class AstroBuilder {
);
}
}

if (config.build.split === true) {
if (config.output !== 'server') {
throw new Error(
'The option `build.split` can only be used when `output` is set to `"server"`.'
);
}
}
}

/** Stats */
Expand Down

0 comments on commit cc8e9de

Please sign in to comment.