Add in Cloudflare Adapter

Preparations for deployment
This commit is contained in:
Nick Bland 2024-04-20 19:23:32 +10:00
parent fa00fa33e5
commit 6a4158b1ec
Signed by: NickBland
GPG Key ID: 31CADD9E5FDD798C
4 changed files with 17 additions and 3 deletions

BIN
bun.lockb

Binary file not shown.

View File

@ -14,6 +14,7 @@
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.0.0", "@eslint/js": "^9.0.0",
"@sveltejs/adapter-auto": "^3.2.0", "@sveltejs/adapter-auto": "^3.2.0",
"@sveltejs/adapter-cloudflare": "^4.4.0",
"@sveltejs/kit": "^2.5.6", "@sveltejs/kit": "^2.5.6",
"@sveltejs/vite-plugin-svelte": "^3.1.0", "@sveltejs/vite-plugin-svelte": "^3.1.0",
"autoprefixer": "^10.4.19", "autoprefixer": "^10.4.19",

10
src/app.d.ts vendored
View File

@ -6,7 +6,15 @@ declare global {
// interface Locals {} // interface Locals {}
// interface PageData {} // interface PageData {}
// interface PageState {} // interface PageState {}
// interface Platform {} interface Platform {
env: {
COUNTER: DurableObjectNamespace;
};
context: {
waitUntil(promise: Promise<any>): void;
};
caches: CacheStorage & { default: Cache };
}
} }
} }

View File

@ -1,4 +1,4 @@
import adapter from "@sveltejs/adapter-auto"; import adapter from "@sveltejs/adapter-cloudflare";
import sveltePreprocess from "svelte-preprocess"; import sveltePreprocess from "svelte-preprocess";
/** @type {import('@sveltejs/kit').Config} */ /** @type {import('@sveltejs/kit').Config} */
@ -11,7 +11,12 @@ const config = {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported or you settled on a specific environment, switch out the adapter. // If your environment is not supported or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters. // See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter(), adapter: adapter({
routes: {
include: ['/*'],
}
}),
}, },
}; };