-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
69 lines (68 loc) · 1.98 KB
/
Copy pathvite.config.ts
File metadata and controls
69 lines (68 loc) · 1.98 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import { defineConfig } from 'vite';
import path from 'node:path';
import solid from 'vite-plugin-solid';
import electron from 'vite-plugin-electron';
import renderer from 'vite-plugin-electron-renderer';
export default defineConfig({
resolve: {
alias: {
'@shared': path.resolve(__dirname, 'src/shared'),
'@main': path.resolve(__dirname, 'src/main'),
'@renderer': path.resolve(__dirname, 'src/renderer'),
},
},
plugins: [
solid(),
electron([
{
entry: 'src/main/main.ts',
vite: {
build: {
outDir: 'dist-electron/main',
rollupOptions: {
// bufferutil / utf-8-validate are OPTIONAL native addons of
// `ws` (pulled in transitively by the sarvamai SDK). They
// aren't installed; `ws` already wraps their require() in a
// try/catch and falls back to pure JS. Marking them external
// keeps them as runtime requires instead of letting Rollup
// emit a hard-failing resolve stub.
external: [
'electron',
'electron-store',
// Loaded from node_modules at runtime (shipped in app
// dependencies); bundling it pulls in dynamic requires.
'electron-updater',
'bufferutil',
'utf-8-validate',
],
},
},
},
},
{
entry: 'src/main/preload.ts',
onstart(args) {
args.reload();
},
vite: {
build: {
outDir: 'dist-electron/preload',
rollupOptions: {
external: ['electron'],
},
},
},
},
]),
renderer(),
],
build: {
outDir: 'dist',
rollupOptions: {
input: {
overlay: path.resolve(__dirname, 'src/renderer/overlay/index.html'),
toolbar: path.resolve(__dirname, 'src/renderer/toolbar/index.html'),
},
},
},
});