-
Notifications
You must be signed in to change notification settings - Fork 8
/
vite.config.ts
35 lines (32 loc) · 1.05 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/// <reference types="vitest" />
/// <reference types="vite/client" />
import { resolve } from 'node:path'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'
export default defineConfig(async () => ({
plugins: [react()],
define: { 'import.meta.env.APP_VERSION': `"${process.env.npm_package_version}"` },
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
// @reference: https://tauri.studio/v1/api/config#buildconfig.beforedevcommand
clearScreen: false,
server: { port: 1420, strictPort: true },
envPrefix: ['VITE_', 'TAURI_'],
resolve: {
alias: [
{ find: '@', replacement: resolve(__dirname, 'src') },
{ find: '~', replacement: resolve(__dirname, 'public') },
],
},
build: {
emptyOutDir: true,
chunkSizeWarningLimit: 1200,
reportCompressedSize: false,
outDir: resolve(__dirname, 'dist'),
},
test: {
globals: true,
environment: 'jsdom',
cache: { dir: './node_modules/.vitest' },
include: ['./**/*.{test,spec}.{ts,tsx}'],
},
}))