-
Notifications
You must be signed in to change notification settings - Fork 82
/
vite.config.ts
47 lines (44 loc) · 1.02 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
import { resolve } from 'path';
import { defineConfig } from 'vite';
import solid from 'vite-plugin-solid';
import svg from 'vite-plugin-solid-svg';
import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin';
// https://vitejs.dev/config/
export default defineConfig({
clearScreen: false,
server: {
strictPort: true,
},
envPrefix: [
'VITE_',
'TAURI_PLATFORM',
'TAURI_ARCH',
'TAURI_FAMILY',
'TAURI_PLATFORM_VERSION',
'TAURI_PLATFORM_TYPE',
'TAURI_DEBUG',
],
root: 'frontend',
build: {
target: ['es2019', 'chrome86', 'safari13'],
minify: !process.env.TAURI_DEBUG ? 'esbuild' : false,
sourcemap: !!process.env.TAURI_DEBUG,
},
plugins: [
vanillaExtractPlugin({
// Revert when vanilla-extract-css/vanilla-extract#1195 merges
identifiers: 'short',
}),
svg({
svgo: {
enabled: false,
},
}),
solid(),
],
resolve: {
alias: [
{ find: /^@\//, replacement: `${resolve(__dirname, 'frontend/src')}/` },
],
},
});