See the official package @sveltejs/adapter-cloudflare-workers
.
Adapter for Svelte apps that builds a Cloudflare Workers application.
npm i @cloudflare/wrangler -g
npm i -D svelte-adapter-cloudflare-workers
svelte.config.js
kit: {
adapter: [
'svelte-adapter-cloudflare-workers',
{
wrangler: {
name: '',
account_id: '',
},
},
],
target: '#svelte',
},
npm run build && npm run adapt
cd build && wrangler publish