28 lines
569 B
TypeScript
28 lines
569 B
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
|
|
const host = process.env.TAURI_DEV_HOST;
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
clearScreen: false,
|
|
server: {
|
|
host: host || false,
|
|
port: 5173,
|
|
strictPort: true,
|
|
hmr: host
|
|
? {
|
|
protocol: 'ws',
|
|
host,
|
|
port: 5183,
|
|
}
|
|
: undefined,
|
|
},
|
|
envPrefix: ['VITE_', 'TAURI_'],
|
|
build: {
|
|
target: 'es2021',
|
|
minify: !process.env.TAURI_DEBUG ? 'esbuild' : false,
|
|
sourcemap: !!process.env.TAURI_DEBUG,
|
|
},
|
|
});
|