electron-vite-vue

May 31, 2026 ยท View on GitHub

๐Ÿฅณ Really simple Electron + Vue + Vite boilerplate.

GitHub Build GitHub Discord

Features

๐Ÿ“ฆ Out of the box ๐ŸŽฏ Based on the official template-vue-ts, less invasive ๐ŸŒฑ Extensible, really simple directory structure ๐Ÿ’ช Support using Node.js API in Electron-Renderer ๐Ÿ”ฉ Support C/C++ native addons ๐Ÿ–ฅ It's easy to implement multiple windows

Quick Setup

# clone the project
git clone https://github.com/electron-vite/electron-vite-vue.git

# enter the project directory
cd electron-vite-vue

# install dependency
npm install

# develop
npm run dev

Debug

electron-vite-react-debug.gif

Directory

+ โ”œโ”€โ”ฌ electron
+ โ”‚ โ”œโ”€โ”ฌ main
+ โ”‚ โ”‚ โ””โ”€โ”€ index.ts    entry of Electron-Main
+ โ”‚ โ””โ”€โ”ฌ preload
+ โ”‚   โ””โ”€โ”€ index.ts    entry of Preload-Scripts
  โ”œโ”€โ”ฌ src
  โ”‚ โ””โ”€โ”€ main.ts       entry of Electron-Renderer
  โ”œโ”€โ”€ index.html
  โ”œโ”€โ”€ package.json
  โ””โ”€โ”€ vite.config.ts

Security Note

The renderer: {} preset in vite.config.ts is only a Vite adapter that polyfills Electron, Node.js APIs and native modules for the renderer process. It is not the same as enabling Node integration. If you want direct Node.js access in the renderer, enable nodeIntegration in the BrowserWindow webPreferences in the main process and review the security impact carefully.

FAQ