i think i got step one working
This commit is contained in:
@ -1,15 +1,30 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
|
||||
// Use TAURI_DEV_HOST when running inside tauri dev, otherwise fall back to localhost.
|
||||
const host = process.env.TAURI_DEV_HOST;
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
base: './',
|
||||
// Prevent vite from obscuring Rust errors in tauri dev
|
||||
clearScreen: false,
|
||||
server: {
|
||||
port: 5173,
|
||||
strictPort: true,
|
||||
host: host || false,
|
||||
hmr: host ? { protocol: 'ws', host, port: 5174 } : undefined,
|
||||
watch: {
|
||||
// Tauri expects a hot reloading mechanism; ignore Rust src changes in Vite
|
||||
ignored: ['**/src-tauri/**'],
|
||||
},
|
||||
},
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
emptyOutDir: true,
|
||||
// Produces smaller bundle sizes compatible with Tauri's webview
|
||||
target: ['es2021', 'chrome105', 'safari13'],
|
||||
minify: !process.env.TAURI_DEBUG ? 'esbuild' : false,
|
||||
sourcemap: !!process.env.TAURI_DEBUG,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user