generated from ZanzyTHEbar/SolidJSTauri
-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
vite.config.ts
50 lines (49 loc) · 1.82 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { resolve } from 'path'
import { optimizeLodashImports } from '@optimize-lodash/rollup-plugin'
import { defineConfig } from 'vite'
import solidPlugin from 'vite-plugin-solid'
export default defineConfig({
clearScreen: false,
envPrefix: ['VITE_', 'TAURI_'],
resolve: {
alias: {
'@interfaces': resolve(__dirname, './src/static/types'),
'@components': resolve(__dirname, './src/components'),
'@containers': resolve(__dirname, './src/containers'),
'@routes': resolve(__dirname, './src/routes'),
'@pages': resolve(__dirname, './src/pages'),
'@styles': resolve(__dirname, './src/styles'),
'@config': resolve(__dirname, './src/config'),
'@src': resolve(__dirname, './src'),
'@assets': resolve(__dirname, './src/assets'),
'@hooks': resolve(__dirname, './src/utils/hooks'),
'@store': resolve(__dirname, './src/store'),
'@static': resolve(__dirname, './src/static'),
'@utils': resolve(__dirname, './src/utils'),
},
},
plugins: [solidPlugin(), optimizeLodashImports()],
server: {
port: 3000,
host: true,
strictPort: true,
watch: {
// 3. tell vite to ignore watching `src-tauri`
ignored: ['**/src-tauri/**'],
},
},
build: {
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
docs: resolve(__dirname, 'src/windows/docs/index.html'),
},
},
// Tauri supports es2021
target: ['es2021', 'esnext'],
// don't minify for debug builds
minify: !process.env.TAURI_DEBUG ? 'esbuild' : false,
// produce sourcemaps for debug builds
sourcemap: !!process.env.TAURI_DEBUG,
},
})