-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support for ServerlessFunctionConfig
and EdgeFunctionConfig
#8458
Conversation
🦋 Changeset detectedLatest commit: 0884253 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
ServerlessFunctionConfig
and EdgeFunctionConfig
Thanks for the PR. Our current plan is to expose this sort of configuration within the routes themselves — #8383 — so we don't want to add adapter-level configuration for this stuff in the meantime (though there probably will be some default config for Until we implement that — hopefully soon — you can achieve the same outcome by modifying the contents of |
That would be awesome @Rich-Harris! I'm currently maintaining a custom vercel adapter that fits my needs: I have taken the much simpler route of defining each route config in const config = {
kit: {
adapter: vercel({
default: {
runtime: 'node',
regions: ['fra1'],
memory: 2048,
maxDuration: 30
},
functions: {
'/(landing)/.*': {
runtime: 'edge',
regions: ['cdg', 'fra']
},
'/api/.*': {
runtime: 'node', // not necessary
memory: 1024,
maxDuration: 45,
},
'/api/images/process': {
memory: 3008,
maxDuration: 60,
},
'/(app)/.*': {
maxDuration: 10,
}
}
})
}
}; A bit less hacky than modifying the contents of |
Adding support for :
memory
,maxDuration
andregions
for Serverless FunctionsenvVarsInUse
andregions
for Edge FunctionsI tried to keep the types structure defined here: https://vercel.com/docs/build-output-api/v3 without breaking the current API.
Limitation: settings cannot be defined on a by function basis when using
split = true
, they are applied globaly.Maybe there is a nicer API for this, but for now:
and on the edge:
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0