@acarl005/adapter-vercel v1.0.0-next.53
adapter-vercel
A SvelteKit adapter that creates a Vercel app.
If you're using adapter-auto, you don't need to install this unless you need to specify Vercel-specific options, since it's already included.
Usage
The
edgeandsplitoptions depend on the Vercel Build Output API which is currently in beta. For now, you must opt in by visitinghttps://vercel.com/[YOUR_USERNAME]/[YOUR_PROJECT]/settings/environment-variablesand addingENABLE_VC_BUILDwith the value1.
Add "@sveltejs/adapter-vercel": "next" to the devDependencies in your package.json and run npm install.
Then in your svelte.config.js:
import vercel from '@sveltejs/adapter-vercel';
export default {
kit: {
// default options are shown
adapter: vercel({
// if true, will deploy the app using edge functions
// (https://vercel.com/docs/concepts/functions/edge-functions)
// rather than serverless functions
edge: false,
// an array of dependencies that esbuild should treat
// as external when bundling functions
external: [],
// if true, will split your app into multiple functions
// instead of creating a single one for the entire app
split: false
})
}
};Notes
Vercel functions contained in the /api directory at the project's root will not be included in the deployment — these should be implemented as endpoints in your SvelteKit app.
Changelog
4 years ago