From 8ae776daa4fbd8bcd8313d0855e59ac651091497 Mon Sep 17 00:00:00 2001 From: Emmanuel Raviart <emmanuel@raviart.com> Date: Tue, 3 Jan 2023 12:17:01 +0100 Subject: [PATCH] Upgrade to latest Svelte Kit settings --- .prettierignore | 18 ++++++++++++++---- package-lock.json | 1 - package.json | 5 ++--- src/app.d.ts | 4 +++- src/app.html | 4 ++-- svelte.config.js | 10 +++------- 6 files changed, 24 insertions(+), 18 deletions(-) diff --git a/.prettierignore b/.prettierignore index 7dde8a0ae..7ab740991 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,14 @@ -.svelte-kit/** -build/** -node_modules/** -static/** +.DS_Store +node_modules +/build +/.svelte-kit +/package +/static/ +.env +.env.* +!.env.example + +# Ignore files for PNPM, NPM and YARN +pnpm-lock.yaml +package-lock.json +yarn.lock diff --git a/package-lock.json b/package-lock.json index 76e18d1e9..6df68adb6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -63,7 +63,6 @@ "svelte-check": "^3.0.1", "svelte-dnd-action": "^0.9.8", "svelte-modals": "^1.0.4", - "svelte-preprocess": "^5.0.0", "tailwindcss": "^3.0.15", "tslib": "^2.0.0", "typescript": "^4.0.0", diff --git a/package.json b/package.json index 4abf8e043..dc9da0e0e 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "dev": "vite dev", - "format": "prettier --plugin-search-dir=. --write .", - "lint": "prettier --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .", + "format": "prettier --plugin-search-dir . --write .", + "lint": "prettier --check --plugin-search-dir . . && eslint --ignore-path .gitignore .", "preview": "vite preview", "test": "playwright test" }, @@ -67,7 +67,6 @@ "svelte-check": "^3.0.1", "svelte-dnd-action": "^0.9.8", "svelte-modals": "^1.0.4", - "svelte-preprocess": "^5.0.0", "tailwindcss": "^3.0.15", "tslib": "^2.0.0", "typescript": "^4.0.0", diff --git a/src/app.d.ts b/src/app.d.ts index 155c2a39e..699ebfc3c 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -2,6 +2,8 @@ // for information about these interfaces // and what to do when importing types declare namespace App { + // interface Error {} + type OpenIdConnectLocals = import("$lib/server/openid_connect_handler").OpenIdConnectLocals type UserLocals = import("$lib/server/user_handler").UserLocals @@ -9,7 +11,7 @@ declare namespace App { id_token?: string user?: import("$lib/users").User } + // interface PageData {} - // interface Error {} // interface Platform {} } diff --git a/src/app.html b/src/app.html index 908c867e5..06151af86 100644 --- a/src/app.html +++ b/src/app.html @@ -6,7 +6,7 @@ <meta name="viewport" content="width=device-width" /> %sveltekit.head% </head> - <body> - <div>%sveltekit.body%</div> + <body data-sveltekit-preload-data="hover"> + <div style="display: contents">%sveltekit.body%</div> </body> </html> diff --git a/svelte.config.js b/svelte.config.js index 35a6f095d..1501682d9 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,5 +1,5 @@ import adapter from "@sveltejs/adapter-node" -import preprocess from "svelte-preprocess" +import { vitePreprocess } from "@sveltejs/kit/vite" /** @type {import('@sveltejs/kit').Config} */ const config = { @@ -17,13 +17,9 @@ const config = { }, }, - // Consult https://github.com/sveltejs/svelte-preprocess + // Consult https://kit.svelte.dev/docs/integrations#preprocessors // for more information about preprocessors - preprocess: [ - preprocess({ - postcss: true, - }), - ], + preprocess: vitePreprocess(), } export default config -- GitLab