# @electron-forge/plugin-vite

> Vite plugin for Electron Forge, lets you use Vite directly in your tooling

Latest version **8.0.1** (published 2026-09-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @electron-forge/plugin-vite
pnpm add @electron-forge/plugin-vite
yarn add @electron-forge/plugin-vite
bun add @electron-forge/plugin-vite
```

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 8.0.1 |
| Published | 2026-09-29 |
| First published | 2023-03-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >= 22.13.0 |
| Dependencies | 5 |
| Unpacked size | 118.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 7169 |
| Author | caoxiemeihao |
| Maintainers | malept, marshallofsound, erickzhao, georgexu99, vertedinde |

## Links

- npm: https://www.npmjs.com/package/@electron-forge/plugin-vite
- Repository: https://github.com/electron/forge
- Homepage: https://github.com/electron/forge#readme
- Issues: https://github.com/electron/forge/issues
- npm.io page: https://npm.io/package/@electron-forge/plugin-vite

## Dependencies (5)

- [debug](https://npm.io/package/debug.md) ^4.3.1
- [listr2](https://npm.io/package/listr2.md) ^11.1.0
- [@electron-forge/core-utils](https://npm.io/package/@electron-forge/core-utils.md) 8.0.1
- [@electron-forge/plugin-base](https://npm.io/package/@electron-forge/plugin-base.md) 8.0.1
- [@electron-forge/shared-types](https://npm.io/package/@electron-forge/shared-types.md) 8.0.1

## Recent versions

- 8.0.1 (latest) — 2026-09-29
- 8.0.0-alpha.10 (alpha) — 2026-07-02
- 8.0.0 — 2026-09-29
- 7.11.2 — 2026-05-20
- 8.0.0-alpha.9 — 2026-05-20
- 8.0.0-alpha.8 — 2026-04-21
- 8.0.0-alpha.7 — 2026-04-10
- 8.0.0-alpha.6 — 2026-03-19
- 8.0.0-alpha.5 — 2026-03-18
- 8.0.0-alpha.4 — 2026-01-14
- 7.11.1 — 2026-01-12
- 7.11.0 — 2026-01-12
- 8.0.0-alpha.3 — 2025-12-04
- 8.0.0-alpha.2 — 2025-12-04
- 8.0.0-alpha.1 — 2025-12-04
- … 26 more at https://npm.io/package/@electron-forge/plugin-vite/versions

## README

## plugin-vite

This plugin makes it easy to set up standard vite tooling to compile both your main process code and your renderer process code, with built-in support for Hot Module Replacement (HMR) in the renderer process and support for multiple renderers.

```javascript
// forge.config.js

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.
        // If you are familiar with Vite configuration, it will look really familiar.
        build: [
          {
            // `entry` is just 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'
          }
        ]
      }
    }
  ]
};
```

### Main process hot restart

Renderer code is hot-reloaded by Vite out of the box, but main process code is
not: the app has to be relaunched to pick it up. Set `hotRestart` to have
`electron-forge start` do that for you whenever a main process bundle rebuilds:

```javascript
// forge.config.js

module.exports = {
  plugins: [
    {
      name: '@electron-forge/plugin-vite',
      config: {
        hotRestart: true,
        build: [
          {
            entry: 'src/main.js',
            config: 'vite.main.config.mjs'
          }
        ],
        renderer: []
      }
    }
  ]
};
```

This is off by default, so main process changes otherwise only take effect when
you type `rs` in the terminal or restart `electron-forge start`. The option has
no effect when packaging.

---
_Source: https://npm.io/package/@electron-forge/plugin-vite · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
