diff options
author | 2023-07-17 14:35:29 +0100 | |
---|---|---|
committer | 2023-07-17 14:35:29 +0100 | |
commit | cc8e9de88179d2ed4b70980c60b41448db393429 (patch) | |
tree | 78033159e969b59b8b654af013f540e01e947a7b | |
parent | c84e8b8e3efa0008e02c1df10250d6706bfc98d9 (diff) | |
download | astro-cc8e9de88179d2ed4b70980c60b41448db393429.tar.gz astro-cc8e9de88179d2ed4b70980c60b41448db393429.tar.zst astro-cc8e9de88179d2ed4b70980c60b41448db393429.zip |
fix: throw an error for incorrect configuration (#7680)
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
-rw-r--r-- | .changeset/dull-weeks-trade.md | 5 | ||||
-rw-r--r-- | packages/astro/src/core/build/index.ts | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/.changeset/dull-weeks-trade.md b/.changeset/dull-weeks-trade.md new file mode 100644 index 000000000..da3e94d35 --- /dev/null +++ b/.changeset/dull-weeks-trade.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Throw an error when `build.split` is set to `true` but `output` isn't set to `"server"`. diff --git a/packages/astro/src/core/build/index.ts b/packages/astro/src/core/build/index.ts index 40cf9decd..07223d29b 100644 --- a/packages/astro/src/core/build/index.ts +++ b/packages/astro/src/core/build/index.ts @@ -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 */ |