From 1fad4816b20f4097f6f7c25cec2f9037b491d0da Mon Sep 17 00:00:00 2001 From: wukko Date: Sun, 16 Jun 2024 19:21:26 +0600 Subject: [PATCH] web: use static svelte adapter instead of auto --- web/package-lock.json | 14 ++++++-------- web/package.json | 2 +- web/src/routes/+layout.ts | 1 + web/svelte.config.js | 17 +++++++++++------ 4 files changed, 19 insertions(+), 15 deletions(-) create mode 100644 web/src/routes/+layout.ts diff --git a/web/package-lock.json b/web/package-lock.json index fa609f93..e4509d63 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -14,7 +14,7 @@ "@tabler/icons-svelte": "^3.6.0" }, "devDependencies": { - "@sveltejs/adapter-auto": "^3.0.0", + "@sveltejs/adapter-static": "^3.0.2", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0", "svelte": "^4.2.7", @@ -706,14 +706,12 @@ "win32" ] }, - "node_modules/@sveltejs/adapter-auto": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@sveltejs/adapter-auto/-/adapter-auto-3.2.1.tgz", - "integrity": "sha512-/3xx8ZFCD5UBc/7AbyXkFF3HNCzWAp2xncH8HA4doGjoGQEN7PmwiRx4Y9nOzi4mqDqYYUic0gaIAE2khWWU4Q==", + "node_modules/@sveltejs/adapter-static": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@sveltejs/adapter-static/-/adapter-static-3.0.2.tgz", + "integrity": "sha512-/EBFydZDwfwFfFEuF1vzUseBoRziwKP7AoHAwv+Ot3M084sE/HTVBHf9mCmXfdM9ijprY5YEugZjleflncX5fQ==", "dev": true, - "dependencies": { - "import-meta-resolve": "^4.1.0" - }, + "license": "MIT", "peerDependencies": { "@sveltejs/kit": "^2.0.0" } diff --git a/web/package.json b/web/package.json index ad8cc3f1..32a8f969 100644 --- a/web/package.json +++ b/web/package.json @@ -20,7 +20,7 @@ }, "homepage": "https://cobalt.tools/", "devDependencies": { - "@sveltejs/adapter-auto": "^3.0.0", + "@sveltejs/adapter-static": "^3.0.2", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0", "svelte": "^4.2.7", diff --git a/web/src/routes/+layout.ts b/web/src/routes/+layout.ts new file mode 100644 index 00000000..189f71e2 --- /dev/null +++ b/web/src/routes/+layout.ts @@ -0,0 +1 @@ +export const prerender = true; diff --git a/web/svelte.config.js b/web/svelte.config.js index 6599b78a..dd053dbc 100644 --- a/web/svelte.config.js +++ b/web/svelte.config.js @@ -1,4 +1,4 @@ -import adapter from '@sveltejs/adapter-auto'; +import adapter from '@sveltejs/adapter-static'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; /** @type {import('@sveltejs/kit').Config} */ @@ -8,11 +8,16 @@ const config = { preprocess: vitePreprocess(), kit: { - // 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. - // See https://kit.svelte.dev/docs/adapters for more information about adapters. - adapter: adapter() - } + adapter: adapter({ + // default options are shown. On some platforms + // these options are set automatically — see below + pages: 'build', + assets: 'build', + fallback: undefined, + precompress: false, + strict: true + }) + } }; export default config;