diff options
author | 2023-08-30 15:10:28 +0100 | |
---|---|---|
committer | 2023-08-30 10:10:28 -0400 | |
commit | c32f52a6246a0f929238f7d47bfc870899729fb4 (patch) | |
tree | a05b69862e055994cbbce4008676f70fe3e68b84 | |
parent | f206bde0ff81cccf7bdb2fcd20922789c7d42135 (diff) | |
download | astro-c32f52a6246a0f929238f7d47bfc870899729fb4.tar.gz astro-c32f52a6246a0f929238f7d47bfc870899729fb4.tar.zst astro-c32f52a6246a0f929238f7d47bfc870899729fb4.zip |
chore: add warnings to console for deprecated options (#8283)
Diffstat (limited to '')
-rw-r--r-- | .changeset/proud-trains-wonder.md | 5 | ||||
-rw-r--r-- | packages/astro/src/core/build/index.ts | 16 |
2 files changed, 13 insertions, 8 deletions
diff --git a/.changeset/proud-trains-wonder.md b/.changeset/proud-trains-wonder.md new file mode 100644 index 000000000..0e437cfad --- /dev/null +++ b/.changeset/proud-trains-wonder.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Add useful warning when deprecated options are still used. diff --git a/packages/astro/src/core/build/index.ts b/packages/astro/src/core/build/index.ts index 013d83a5b..5280e69e3 100644 --- a/packages/astro/src/core/build/index.ts +++ b/packages/astro/src/core/build/index.ts @@ -242,6 +242,10 @@ class AstroBuilder { 'The option `build.split` won\'t take effect, because `output` is not `"server"` or `"hybrid"`.' ); } + this.logger.warn( + 'configuration', + 'The option `build.split` is deprecated. Use the adapter options.' + ); } if (config.build.excludeMiddleware === true) { if (config.output === 'static') { @@ -250,14 +254,10 @@ class AstroBuilder { 'The option `build.excludeMiddleware` won\'t take effect, because `output` is not `"server"` or `"hybrid"`.' ); } - } - - 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"`.' - ); - } + this.logger.warn( + 'configuration', + 'The option `build.excludeMiddleware` is deprecated. Use the adapter options.' + ); } } |