Alternative SvelteKit adaptor for Cloudflare workers. Designed to be standalone and not use wrangler.
npm install --save-dev @budgetdraw/sveltekit-cloudflare-adapter
Add the adapter to your svelte.config.js
:
import adapter from '@budgetdraw/sveltekit-cloudflare-adapter'
export default {
kit: {
target: '#svelte',
adapter: adapter()
}
}
In addition to the normal SvelteKit API, the request object has an additional
cfFetchEvent
property containing the
Cloudflare Worker FetchEvent.
This is primarily to allow for waitUntil method
in order to perform an action after the response has been sent to the user - for
example in order to pass to toucan-js.