-
Notifications
You must be signed in to change notification settings - Fork 32
/
vite.config.mts
54 lines (52 loc) · 1.19 KB
/
vite.config.mts
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
51
52
53
54
import path from 'path'
import react from '@vitejs/plugin-react-swc'
import { defineConfig } from 'vite'
import dynamicImport from 'vite-plugin-dynamic-import'
import { viteStaticCopy } from 'vite-plugin-static-copy'
export default defineConfig({
root: 'packages/pastebar-ui',
clearScreen: false,
server: {
port: 1420,
open: false,
strictPort: true,
},
define: {
BUILD_DATE: JSON.stringify(new Date().valueOf()),
APP_VERSION: JSON.stringify(require('./package.json').version),
},
envPrefix: [
'VITE_',
'TAURI_PLATFORM',
'TAURI_ARCH',
'TAURI_FAMILY',
'TAURI_PLATFORM_VERSION',
'TAURI_PLATFORM_TYPE',
'TAURI_DEBUG',
],
build: {
outDir: path.join(__dirname, 'packages/dist-ui'),
emptyOutDir: true,
commonjsOptions: { defaultIsModuleExports: 'auto' },
target: ['es2015', 'safari11'],
minify: !process.env.TAURI_DEBUG ? 'esbuild' : false,
sourcemap: !!process.env.TAURI_DEBUG,
},
optimizeDeps: {
esbuildOptions: {
plugins: [],
},
},
plugins: [
react(),
dynamicImport(),
viteStaticCopy({
targets: [
{
src: 'drop-*',
dest: '.',
},
],
}),
],
})