English | 简体中文
Support development Electron App using Farm.
To begin, you'll need to @farmfe/js-plugin-electron
:
npm install @farmfe/js-plugin-electron --save-dev
or
yarn add -D @farmfe/js-plugin-electron
or
pnpm add -D @farmfe/js-plugin-electron
Configuring the plugin in farm.config.ts
:
import { defineConfig } from '@farmfe/core'
import electron from '@farmfe/js-plugin-electron'
import { defineConfig } from '@farmfe/core'
import electron from './farm-plugin-electron'
export default defineConfig({
plugins: [
electron({
main: {
input: 'electron/main.ts',
},
preload: {
input: 'electron/preload.ts',
},
}),
],
})
Type:
import type { UserConfig } from '@farmfe/core'
export interface BuildOptions {
/**
* Shortcut of `compilation.input`
*/
input: string | Record<string, string>
farm?: UserConfig
}
export interface ElectronPluginOptions {
main: BuildOptions
preload?: BuildOptions
}