-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathvite.config.mjs
45 lines (44 loc) · 918 Bytes
/
vite.config.mjs
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
import { resolve } from 'path'
import { defineConfig } from 'vite'
import { svelte, vitePreprocess } from '@sveltejs/vite-plugin-svelte'
import electron from 'vite-plugin-electron'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
base: '/',
clearScreen: false,
resolve: {
alias: {
'@': resolve(__dirname, './src'),
},
},
build: {
outDir: './build/web',
sourcemap: true,
target: 'chrome106',
},
plugins: [
svelte({
preprocess: vitePreprocess(),
}),
tailwindcss(),
electron({
entry: ['./src/electron/main.ts', './src/electron/preload.ts'],
onstart({ startup }) {
if (process.electronApp) {
process.kill(process.electronApp.pid, 'SIGTERM')
} else {
startup()
}
},
vite: {
build: {
outDir: './build/electron',
emptyOutDir: true,
rollupOptions: {
external: [/^.*\.node$/],
},
},
},
}),
],
})