-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
52 lines (49 loc) · 1.07 KB
/
vite.config.js
File metadata and controls
52 lines (49 loc) · 1.07 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
import { defineConfig, loadEnv } from 'vite'
import electron from 'vite-plugin-electron/simple'
import path from 'path'
import { fileURLToPath } from 'url'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
// Load .env file for build-time environment variables
const env = loadEnv('', process.cwd(), '')
export default defineConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
optimizeDeps: {
exclude: []
},
build: {
commonjsOptions: {
include: [/node_modules/]
}
},
esbuild: {
target: 'esnext',
keepNames: true
},
plugins: [
electron({
main: {
entry: 'electron/main.ts',
vite: {
define: {
'process.env.APTABASE_APP_KEY': JSON.stringify(env.APTABASE_APP_KEY || ''),
},
build: {
rollupOptions: {
external: [
'onnxruntime-node',
],
},
},
},
},
preload: {
input: 'electron/preload.ts',
},
renderer: {},
}),
],
})