0
Fork 0
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:
Emanuele Stoppa 2023-08-30 15:10:28 +01:00 committed by GitHub
parent f206bde0ff
commit c32f52a624
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 8 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Add useful warning when deprecated options are still used.

View file

@ -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.'
);
}
}