import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import path from 'path';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@/components': path.resolve(__dirname, './src/components'),
'@/lib': path.resolve(__dirname, './src/lib'),
'@/hooks': path.resolve(__dirname, './src/hooks'),
'@/stores': path.resolve(__dirname, './src/stores'),
'@/utils': path.resolve(__dirname, './src/utils'),
},
},
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
clearScreen: false,
server: {
port: 1420,
strictPort: true,
watch: {
ignored: ['**/src-tauri/**']
}
},
build: {
target: 'esnext',
minify: !process.env.TAURI_DEBUG ? 'esbuild' : false,
sourcemap: !!process.env.TAURI_DEBUG,
},
});