-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
electron.vite.config.ts
64 lines (63 loc) · 1.63 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import federation from '@originjs/vite-plugin-federation';
import react from '@vitejs/plugin-react';
import {defineConfig, externalizeDepsPlugin} from 'electron-vite';
import {resolve} from 'path';
export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()],
build: {rollupOptions: {output: {format: 'cjs'}}},
},
preload: {
plugins: [externalizeDepsPlugin()],
build: {
rollupOptions: {
output: {
format: 'cjs',
},
input: {
index: resolve(__dirname, 'src/preload/index.js'),
dialog: resolve(__dirname, 'src/preload/dialog.js'),
webview: resolve(__dirname, 'src/preload/webview.js'),
},
},
},
},
renderer: {
plugins: [
react(),
federation({
name: 'host-app',
remotes: {nothing: 'nothing.js'},
shared: [
'antd',
'react',
'lodash',
'react-dom',
'react-redux',
'react-router',
'mobx-react-lite',
'@nextui-org/react',
],
}),
],
base: '',
define: {
'process.env': {},
},
build: {
rollupOptions: {
input: {
index: resolve(__dirname, 'src/renderer/index.html'),
initializer: resolve(__dirname, 'src/renderer/initializer.html'),
loading: resolve(__dirname, 'src/renderer/loading.html'),
dialog: resolve(__dirname, 'src/renderer/dialog.html'),
},
},
target: 'esnext',
minify: false,
cssCodeSplit: false,
modulePreload: false,
},
publicDir: resolve(__dirname, 'src/renderer/public'),
},
});