Vite Plugin
Transform and bundle code for your Electron Forge app with Vite.
Installation
npm install --save-dev @electron-forge/plugin-viteUsage
Plugin configuration
module.exports = {
plugins: [
{
name: '@electron-forge/plugin-vite',
config: {
// `build` can specify multiple entry builds, which can be
// Main process, Preload scripts, Worker process, etc.
build: [
{
// `entry` is an alias for `build.lib.entry`
// in the corresponding file of `config`.
entry: 'src/main.js',
config: 'vite.main.config.mjs'
},
{
entry: 'src/preload.js',
config: 'vite.preload.config.mjs'
}
],
renderer: [
{
name: 'main_window',
config: 'vite.renderer.config.mjs'
}
]
}
}
]
};Project files
Advanced configuration
Build concurrency
Native Node modules
Hot Module Replacement (HMR)
Last updated
Was this helpful?