|
| 1 | +import path from 'node:path'; |
| 2 | +import { defineConfig } from '@farmfe/core'; |
| 3 | +import electron from '@farmfe/js-plugin-electron'; |
| 4 | +import farmPluginPostcss from '@farmfe/js-plugin-postcss'; |
| 5 | +import solid from 'vite-plugin-solid'; |
| 6 | + |
| 7 | +export default defineConfig({ |
| 8 | + compilation: { |
| 9 | + input: { |
| 10 | + main: 'renderer/index.html', |
| 11 | + settings: 'renderer/settings.html', |
| 12 | + lyrics: 'renderer/lyrics.html', |
| 13 | + tray: 'renderer/tray.html', |
| 14 | + }, |
| 15 | + output: { |
| 16 | + path: 'dist', |
| 17 | + }, |
| 18 | + external: [ |
| 19 | + 'electron', |
| 20 | + '@alexssmusica/ffi-napi', |
| 21 | + '@alexssmusica/ref-napi', |
| 22 | + '@jellybrick/wql-process-monitor', |
| 23 | + 'mica-electron', |
| 24 | + 'glasstron', |
| 25 | + 'hmc-win32', |
| 26 | + 'extract-file-icon', |
| 27 | + ], |
| 28 | + }, |
| 29 | + vitePlugins: [ |
| 30 | + () => ({ |
| 31 | + vitePlugin: solid(), |
| 32 | + filters: ['\\.tsx$', '\\.jsx$'] |
| 33 | + }) |
| 34 | + ], |
| 35 | + plugins: [ |
| 36 | + electron({ |
| 37 | + main: { |
| 38 | + input: './index.ts', |
| 39 | + farm: { |
| 40 | + compilation: { |
| 41 | + externalNodeBuiltins: true, |
| 42 | + external: [ |
| 43 | + '@alexssmusica/ffi-napi', |
| 44 | + '@alexssmusica/ref-napi', |
| 45 | + '@jellybrick/wql-process-monitor', |
| 46 | + 'mica-electron', |
| 47 | + 'glasstron', |
| 48 | + 'hmc-win32', |
| 49 | + 'extract-file-icon', |
| 50 | + ], |
| 51 | + output: { |
| 52 | + targetEnv: 'node-next', |
| 53 | + path: 'dist', |
| 54 | + }, |
| 55 | + }, |
| 56 | + }, |
| 57 | + }, |
| 58 | + preload: { |
| 59 | + input: './src/preload.ts', |
| 60 | + farm: { |
| 61 | + compilation: { |
| 62 | + externalNodeBuiltins: true, |
| 63 | + external: [ |
| 64 | + 'hmc-win32', |
| 65 | + 'font-list', |
| 66 | + ], |
| 67 | + output: { |
| 68 | + targetEnv: 'node-next', |
| 69 | + path: 'dist', |
| 70 | + }, |
| 71 | + }, |
| 72 | + }, |
| 73 | + }, |
| 74 | + }), |
| 75 | + farmPluginPostcss(), |
| 76 | + ], |
| 77 | +}); |
0 commit comments