-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathelectron.vite.config.ts
46 lines (45 loc) · 1.31 KB
/
electron.vite.config.ts
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
import { sentryVitePlugin } from '@sentry/vite-plugin';
import { TanStackRouterVite } from '@tanstack/router-plugin/vite';
import viteReact from '@vitejs/plugin-react';
import { defineConfig, externalizeDepsPlugin } from 'electron-vite';
import { resolve } from 'path';
export default defineConfig({
main: {
build: { sourcemap: true },
plugins: [
externalizeDepsPlugin(),
sentryVitePlugin({
org: 'elek-io',
project: 'client',
}),
],
},
preload: {
build: {
rollupOptions: {
output: {
// With a sandboxed renderer and preload process the preload cannot use ESM
// This is a current (v31.2) limitation of using ESM in Electron
// @see https://www.electronjs.org/docs/latest/tutorial/esm#summary-esm-support-matrix
// @see https://github.com/alex8088/electron-vite/discussions/423#discussioncomment-8922407
format: 'cjs',
},
},
},
// plugins: [externalizeDepsPlugin()], @see above
},
renderer: {
resolve: {
alias: {
'@renderer': resolve('src/renderer/src'),
},
},
plugins: [
TanStackRouterVite({
routesDirectory: './src/renderer/src/routes',
generatedRouteTree: './src/renderer/src/routeTree.gen.ts',
}),
viteReact(),
],
},
});