2024-12-13 17:20:14 +03:00
|
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
|
|
|
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
2025-01-10 19:39:32 +03:00
|
|
|
import tailwindcss from '@tailwindcss/vite';
|
2024-12-13 17:20:14 +03:00
|
|
|
//import vueDevTools from 'vite-plugin-vue-devtools'
|
|
|
|
|
|
|
|
|
|
const host = process.env.TAURI_DEV_HOST
|
|
|
|
|
|
|
|
|
|
// https://vite.dev/config/
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
plugins: [
|
|
|
|
|
vue(),
|
2025-01-10 19:39:32 +03:00
|
|
|
tailwindcss(),
|
2024-12-13 17:20:14 +03:00
|
|
|
// vueDevTools(),
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
|
|
|
|
|
//
|
|
|
|
|
// 1. prevent vite from obscuring rust errors
|
|
|
|
|
clearScreen: false,
|
|
|
|
|
// 2. tauri expects a fixed port, fail if that port is not available
|
|
|
|
|
server: {
|
|
|
|
|
port: 1420,
|
|
|
|
|
strictPort: true,
|
|
|
|
|
host: host || false,
|
|
|
|
|
hmr: host
|
|
|
|
|
? {
|
|
|
|
|
protocol: 'ws',
|
|
|
|
|
host,
|
|
|
|
|
port: 1421,
|
|
|
|
|
}
|
|
|
|
|
: undefined,
|
|
|
|
|
watch: {
|
|
|
|
|
// 3. tell vite to ignore watching `src-tauri`
|
|
|
|
|
ignored: ['**/src-tauri/**'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
resolve: {
|
|
|
|
|
alias: {
|
|
|
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
build: {
|
|
|
|
|
chunkSizeWarningLimit: 1000, // size in kB
|
|
|
|
|
},
|
|
|
|
|
})
|