@electron-forge/plugin-vite
TypeScript icon, indicating that this package has built-in type declarations

7.5.0 • Public • Published

plugin-vite

Note: This plugin is considered experimental and is under active development; we do not offer API stability guarantees as development continues. Minor versions may include breaking changes - see release notes for details on migration.

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.

// 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'
          }
        ]
      }
    }
  ]
};

/@electron-forge/plugin-vite/

    Package Sidebar

    Install

    npm i @electron-forge/plugin-vite

    Weekly Downloads

    9,632

    Version

    7.5.0

    License

    MIT

    Unpacked Size

    66.1 kB

    Total Files

    35

    Last publish

    Collaborators

    • vertedinde
    • georgexu99
    • erickzhao
    • malept
    • marshallofsound