mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-09-16 18:42:03 +00:00
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.
This commit is contained in:
@@ -1,10 +1,21 @@
|
||||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { defineConfig } from 'vite';
|
||||
import { SvelteKitPWA } from '@vite-pwa/sveltekit';
|
||||
// you don't need to do this if you're using generateSW strategy in your app
|
||||
import { generateSW } from './pwa.mjs';
|
||||
|
||||
export default defineConfig({
|
||||
resolve: {
|
||||
alias:
|
||||
process.env.DEPLOY_TARGET === 'cloudflare'
|
||||
? {
|
||||
'$lib/server/compression': fileURLToPath(
|
||||
new URL('./src/lib/server/compression.cloudflare.ts', import.meta.url)
|
||||
)
|
||||
}
|
||||
: {}
|
||||
},
|
||||
plugins: [
|
||||
sveltekit(),
|
||||
SvelteKitPWA({
|
||||
|
||||
Reference in New Issue
Block a user