This short article describes how to deploy a SvelteKit app inside a monorepo (using Turborepo) to Cloudflare pages.
When you have set up the app in the monorepo, you are ready to deploy it.
Create a new page under «Workers and Pages» in the Clouflare Dashboard. The config should be as follows:
I'm assuming that the SvelteKit app is called «web-sveltekit», update this as needed
- Build command:
npx turbo run build --filter=web-sveltekit...
- Build output directory:
- Root directory:
Cloudflare pages will detect your build system (yarn, npm, ..) and run the correct install command from the root of your project. It will then use turbo to run build for only your SvelteKit app (that's what the filter does). It then looks in the «build output directory» for the code to deploy.