Skitty
Template for building SvelteKit + Tauri (Skitty)
Warning
This project is supposed to be used temporary only (until svelte-add
tauri has finished). Consider checking svlete-add
before continue.
Table of contents
Developing
$ git clone https://github.com/Mattchine/skitty <your path>
$ cd <your path>
$ yarn tauri dev
Configure / Step-by-step guide
- Create project with svelte-add
$ npm init @svelte-add/kit@latest
# Follow the prompts to select the integrations you want
- Add Tauri to your project
$ cd <your path>
$ yarn add -D @tauri-apps/cli
$ yarn add @tauri-apps/api
- Disable SvelteKit SSR (I have problem with this for days, thanks to jsmenzies)
- 3.1 Create
src/hook.ts
/** @type {import('@sveltejs/kit').Handle} */
export async function handle({ event, resolve }) {
return await resolve(event, {
ssr: false
});
}
- 3.2 Add
hook.ts
tosvelte.config.js
kit: {
files: {
hooks: 'src/hooks.ts'
}
}
- Change tauri config
src-tauri/tauri.conf.json
- 4.1 Change
devPath
from PORT8080
PORT3000
- 4.2 Set
beforeDevCommand
andbeforeBuildCommand
"build": {
"distDir": "../public",
"devPath": "http://localhost:3000",
"beforeDevCommand": "yarn dev",
"beforeBuildCommand": "yarn build"
},
- Done! now you can run
$ yarn tauri dev
Notes
- This repository is for my future self and hope it would help someone out there too.
Special Thanks
- jsmenzies
- svelte-add
- And, of course, all underlying project:
Svelte
,SvelteKit
,Taiilwind
,Tauri
, and many mores!.