-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathelectron.vite.config.js
More file actions
40 lines (36 loc) · 1.08 KB
/
electron.vite.config.js
File metadata and controls
40 lines (36 loc) · 1.08 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
import {resolve} from 'node:path'
import react from '@vitejs/plugin-react'
import {defineConfig, externalizeDepsPlugin, swcPlugin} from 'electron-vite'
import tsconfigPaths from 'vite-tsconfig-paths'
import 'dotenv/config'
console.log('GA_MEASUREMENT_ID:', process.env.GA_MEASUREMENT_ID)
export default defineConfig({
main: {
resolve: {
alias: {
'@main': resolve('src/main'),
'@common': resolve('src/main/common'),
'@preload': resolve('src/preload'),
},
},
plugins: [externalizeDepsPlugin(), swcPlugin()],
define: {
__GA_MEASUREMENT_ID__: JSON.stringify(process.env.GA_MEASUREMENT_ID),
__GA_API_SECRET__: JSON.stringify(process.env.GA_API_SECRET),
__VITE_SENTRY_DSN__: JSON.stringify(process.env.VITE_SENTRY_DSN),
},
},
preload: {
plugins: [externalizeDepsPlugin()],
},
renderer: {
resolve: {
alias: {
'@': resolve('src/renderer'),
'@render': resolve('src/renderer'),
'@components': resolve('src/renderer/components'),
},
},
plugins: [react(), tsconfigPaths()],
},
})