Skip to content

Commit

Permalink
fix(@astrojs/vercel): warn user when functionPerRoute is true (#8319
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ematipico authored Aug 31, 2023
1 parent 1efd51f commit dc29e0f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/thirty-bees-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/vercel': patch
---

Add warning when `functionPerRoute` is set to `true`
7 changes: 6 additions & 1 deletion packages/integrations/vercel/src/serverless/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dc29e0f

Please sign in to comment.