Files
LivingDexTracker/svelte.config.js
T
Josh Creek 2766e5ea67 build(cloudflare): add a Cloudflare preview build target
DEPLOY_TARGET now selects the adapter; Netlify stays the default and NODE_ADAPTER
keeps working. Cloudflare compresses in transit, so the Worker build aliases
$lib/server/compression to a pass-through that leaves the streaming body alone.

CI builds and dry-run deploys this target. That is compilation and packaging
coverage only, not a production compatibility gate: native sharp still blocks the
share-preview route in the Worker runtime.
2026-09-15 17:47:14 +01:00

28 lines
937 B
JavaScript

import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
// you don't need to do this if you're using generateSW strategy in your app
import { generateSW } from './pwa.mjs';
import { adapter } from './adapter.mjs';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: vitePreprocess(),
kit: {
// Netlify by default; DEPLOY_TARGET selects the Cloudflare preview or Node test build.
adapter,
serviceWorker: {
// VitePWA owns registration. Registering here as well requests SvelteKit's default
// /service-worker.js even though the inject-manifest output is /prompt-sw.js.
register: false
},
files: {
// you don't need to do this if you're using generateSW strategy in your app
serviceWorker: generateSW ? undefined : 'src/prompt-sw.ts'
}
}
};
export default config;