ti-pote/apps/frontend/vite.config.ts
2026-04-08 19:59:47 +02:00

33 lines
688 B
TypeScript

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'node:path';
// @ts-expect-error process is provided by Node at config time
const host = process.env.TAURI_DEV_HOST;
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
// Tauri expects a fixed port and silences console noise
clearScreen: false,
server: {
port: 1420,
strictPort: true,
host: host || false,
hmr: host
? {
protocol: 'ws',
host,
port: 1421,
}
: undefined,
watch: {
ignored: ['**/src-tauri/**'],
},
},
});