mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
chore: add warnings to console for deprecated options (#8283)
This commit is contained in:
parent
f206bde0ff
commit
c32f52a624
2 changed files with 13 additions and 8 deletions
5
.changeset/proud-trains-wonder.md
Normal file
5
.changeset/proud-trains-wonder.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Add useful warning when deprecated options are still used.
|
|
@ -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.'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue