mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-17 23:13:51 +01:00
30 lines
799 B
TypeScript
30 lines
799 B
TypeScript
import { defineConfig } from 'vite';
|
|
import react from '@vitejs/plugin-react';
|
|
import { internalIpV4 } from 'internal-ip';
|
|
import svgr from 'vite-plugin-svgr';
|
|
import topLevelAwait from 'vite-plugin-top-level-await';
|
|
|
|
const mobile = !!/android|ios/.exec(process.env.TAURI_ENV_PLATFORM ?? '');
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig(async () => ({
|
|
plugins: [svgr(), react(), topLevelAwait()],
|
|
clearScreen: false,
|
|
server: {
|
|
port: 1420,
|
|
strictPort: true,
|
|
host: mobile ? '0.0.0.0' : false,
|
|
hmr: mobile
|
|
? {
|
|
protocol: 'ws',
|
|
host: await internalIpV4(),
|
|
port: 1421,
|
|
}
|
|
: undefined,
|
|
watch: {
|
|
ignored: ['**/src-tauri/**', '**/designs/**', '**/plugins/**'],
|
|
},
|
|
},
|
|
envPrefix: ['VITE_', 'TAURI_'],
|
|
}));
|