[READ-ONLY] Mirror of https://github.com/probablykasper/svelte-tauri-filedrop. Tauri file drop handling component for Svelte
dropzone
filedrop
package
svelte
tauri
731 B
31 lines
1import { defineConfig } from 'vite'
2import { sveltekit } from '@sveltejs/kit/vite'
3
4// @ts-expect-error process is a nodejs global
5const host = process.env.TAURI_DEV_HOST
6
7export default defineConfig({
8 plugins: [sveltekit()],
9
10 // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
11 //
12 // 1. prevent vite from obscuring rust errors
13 clearScreen: false,
14 // 2. tauri expects a fixed port, fail if that port is not available
15 server: {
16 port: 1420,
17 strictPort: true,
18 host: host || false,
19 hmr: host
20 ? {
21 protocol: 'ws',
22 host,
23 port: 1421,
24 }
25 : undefined,
26 watch: {
27 // 3. tell vite to ignore watching `src-tauri`
28 ignored: ['**/src-tauri/**'],
29 },
30 },
31})