0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00

fix(@astrojs/vercel): warn user when functionPerRoute is true (#8319)

This commit is contained in:
Emanuele Stoppa 2023-08-31 15:36:37 +01:00 committed by GitHub
parent 1efd51fb47
commit dc29e0f797
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/vercel': patch
---
Add warning when `functionPerRoute` is set to `true`

View file

@ -129,7 +129,12 @@ export default function vercelServerless({
...getImageConfig(imageService, imagesConfig, command),
});
},
'astro:config:done': ({ setAdapter, config }) => {
'astro:config:done': ({ setAdapter, config, logger }) => {
if (functionPerRoute === true) {
logger.warn(
"The Vercel plans might have limits to the number of functions you can create, make sure to check them if you don't want to incur into additional costs."
);
}
setAdapter(getAdapter({ functionPerRoute, edgeMiddleware }));
_config = config;
buildTempFolder = config.build.server;