File tree 5 files changed +21
-8
lines changed
5 files changed +21
-8
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " create-tauri-app " : " patch"
3
+ " create-tauri-app-js " : " patch"
4
+ ---
5
+
6
+ Changed Svelte templates to use ` @sveltejs/adapter-static ` 's fallback feature instead of disabling SSR per-router, See https://svelte.dev/docs/kit/single-page-apps
7
+
Original file line number Diff line number Diff line change 1
1
// Tauri doesn't have a Node.js server to do proper SSR
2
- // so we will use adapter-static to prerender the app (SSG)
2
+ // so we use adapter-static with a fallback to index.html to put the site in SPA mode
3
+ // See: https://svelte.dev/docs/kit/single-page-apps
3
4
// See: https://v2.tauri.app/start/frontend/sveltekit/ for more info
4
- export const prerender = true ;
5
5
export const ssr = false ;
Original file line number Diff line number Diff line change 1
1
// Tauri doesn't have a Node.js server to do proper SSR
2
- // so we will use adapter-static to prerender the app (SSG)
2
+ // so we use adapter-static with a fallback to index.html to put the site in SPA mode
3
+ // See: https://svelte.dev/docs/kit/single-page-apps
3
4
// See: https://v2.tauri.app/start/frontend/sveltekit/ for more info
4
5
import adapter from "@sveltejs/adapter-static" ;
5
6
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte" ;
@@ -8,7 +9,9 @@ import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
8
9
const config = {
9
10
preprocess : vitePreprocess ( ) ,
10
11
kit : {
11
- adapter : adapter ( ) ,
12
+ adapter : adapter ( {
13
+ fallback : "index.html" ,
14
+ } ) ,
12
15
} ,
13
16
} ;
14
17
Original file line number Diff line number Diff line change 1
1
// Tauri doesn't have a Node.js server to do proper SSR
2
- // so we will use adapter-static to prerender the app (SSG)
2
+ // so we use adapter-static with a fallback to index.html to put the site in SPA mode
3
+ // See: https://svelte.dev/docs/kit/single-page-apps
3
4
// See: https://v2.tauri.app/start/frontend/sveltekit/ for more info
4
- export const prerender = true ;
5
5
export const ssr = false ;
Original file line number Diff line number Diff line change 1
1
// Tauri doesn't have a Node.js server to do proper SSR
2
- // so we will use adapter-static to prerender the app (SSG)
2
+ // so we use adapter-static with a fallback to index.html to put the site in SPA mode
3
+ // See: https://svelte.dev/docs/kit/single-page-apps
3
4
// See: https://v2.tauri.app/start/frontend/sveltekit/ for more info
4
5
import adapter from "@sveltejs/adapter-static" ;
5
6
6
7
/** @type {import('@sveltejs/kit').Config } */
7
8
const config = {
8
9
kit : {
9
- adapter : adapter ( ) ,
10
+ adapter : adapter ( {
11
+ fallback : "index.html" ,
12
+ } ) ,
10
13
} ,
11
14
} ;
12
15
You can’t perform that action at this time.
0 commit comments