···11import "../app.css";
22+import { debounce } from "@std/async";
33+import { saveWindowState, StateFlags } from "@tauri-apps/plugin-window-state";
44+import { listen, type Event, TauriEvent } from "@tauri-apps/api/event";
2536// Tauri doesn't have a Node.js server to do proper SSR
47// so we use adapter-static with a fallback to index.html to put the site in SPA mode
58// See: https://svelte.dev/docs/kit/single-page-apps
69// See: https://v2.tauri.app/start/frontend/sveltekit/ for more info
710export const ssr = false;
1111+1212+const debounced = debounce((_: Event<TauriEvent.WINDOW_RESIZED>) => {
1313+ saveWindowState(StateFlags.ALL);
1414+}, 250);
1515+1616+listen("tauri://resize", debounced);
+3-2
vite.config.js
···11import { defineConfig } from "vite";
22import { sveltekit } from "@sveltejs/kit/vite";
33+import deno from "@deno/vite-plugin";
34import tailwindcss from "@tailwindcss/vite";
4556// @ts-expect-error process is a nodejs global
66-const host = process.env.TAURI_DEV_HOST;
77+const host = Deno.env.get("TAURI_DEV_HOST");
7889// https://vite.dev/config/
910export default defineConfig(async () => ({
1010- plugins: [sveltekit(), tailwindcss()],
1111+ plugins: [sveltekit(), tailwindcss(), deno()],
11121213 // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
1314 //