-
Notifications
You must be signed in to change notification settings - Fork 429
Expand file tree
/
Copy pathvite.config.ts
More file actions
68 lines (67 loc) · 1.76 KB
/
Copy pathvite.config.ts
File metadata and controls
68 lines (67 loc) · 1.76 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
import { defineConfig } from 'vite'
import electron from 'vite-plugin-electron/simple'
import react from '@vitejs/plugin-react'
export default defineConfig({
build: {
outDir: 'dist/renderer',
},
plugins: [
react(),
electron({
main: {
entry: 'src/main/index.ts',
vite: {
build: {
outDir: 'dist/main',
rollupOptions: {
external: [
'better-sqlite3',
'assemblyai',
'pdf-parse',
'@sentry/electron',
'@sentry/electron/main',
'@recallai/desktop-sdk',
'onnxruntime-node',
'onnxruntime-web',
'sharp',
],
output: {
entryFileNames: 'index.js',
banner: `
import { fileURLToPath as __vite_fileURLToPath } from 'url';
import { dirname as __vite_dirname } from 'path';
const __filename = __vite_fileURLToPath(import.meta.url);
const __dirname = __vite_dirname(__filename);
`,
},
},
},
},
},
preload: {
input: 'src/preload/index.ts',
vite: {
build: {
outDir: 'dist/preload',
rollupOptions: {
output: {
format: 'cjs',
entryFileNames: 'index.cjs',
},
},
},
},
},
renderer: process.env.NODE_ENV === 'test' ? undefined : {
build: {
rollupOptions: {
input: {
index: 'src/renderer/index.html',
},
},
},
assetsInclude: ['**/*.js'],
},
}),
],
})