-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfarm.config.ts
77 lines (74 loc) · 1.88 KB
/
farm.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
65
66
67
68
69
70
71
72
73
74
75
76
77
import path from 'node:path';
import { defineConfig } from '@farmfe/core';
import farmPluginPostcss from '@farmfe/js-plugin-postcss';
import electron from '@farmfe/js-plugin-electron';
import solid from 'vite-plugin-solid';
export default defineConfig({
compilation: {
sourcemap: false,
input: {
main: path.join(__dirname, './renderer/index.html'),
settings: path.join(__dirname, './renderer/settings.html'),
lyrics: path.join(__dirname, './renderer/lyrics.html'),
tray: path.join(__dirname, './renderer/tray.html'),
},
output: {
targetEnv: 'browser-esnext',
path: 'dist',
publicPath: './',
},
},
vitePlugins: [
() => ({
vitePlugin: solid(),
filters: ['\\.tsx$', '\\.jsx$']
})
],
plugins: [
electron({
main: {
input: './index.ts',
farm: {
compilation: {
sourcemap: false,
externalNodeBuiltins: true,
external: [
'^electron$',
'^@alexssmusica/ffi-napi$',
'^@alexssmusica/ref-napi$',
'^@jellybrick/wql-process-monitor$',
'^mica-electron$',
'^glasstron$',
'^hmc-win32$',
'^extract-file-icon$',
'^node-window-manager$'
],
output: {
targetEnv: 'node-next',
path: 'dist',
},
},
},
},
preload: {
input: './src/preload.ts',
farm: {
compilation: {
sourcemap: false,
externalNodeBuiltins: true,
external: [
'^electron$',
'^hmc-win32$',
'^font-list$',
],
output: {
targetEnv: 'node-next',
path: 'dist',
},
},
},
},
}),
farmPluginPostcss(),
],
});