English | 简体中文
Rselectron is an Rspack-first Electron development and build tool. Develop and source-build Electron apps with Rsbuild and Rspack.
- ⚡️ Rsbuild / Rspack powered, with Electron-oriented defaults
- 🛠 Single config for main, preload, and renderer
- 🚀 Fast builds with Rust-based parallel compilation
- 🔥 Renderer HMR, plus hot reload for main and preload
- 💡 Asset handling tuned for the Electron main process
- ✨ Isolated builds for multi-entry Electron apps
- 🔌 Framework agnostic — use any UI stack your Rsbuild setup supports
- 📦 Out-of-the-box TypeScript support, plus
inspectfor debugging config
npm i @rselectron/core @rsbuild/core -D@rsbuild/core is a required project peer (npm 7+ / pnpm 8+ install it automatically). Rselectron warns — never blocks — when the installed Rsbuild minor is outside the release's tested window.
Add npm scripts to your package.json:
{
"scripts": {
"dev": "rselectron dev",
"build": "rselectron build",
"preview": "rselectron preview"
}
}When you run the CLI, Rselectron resolves a config file at the project root (for example rselectron.config.ts). A minimal config looks like this:
import { defineConfig } from '@rselectron/core';
export default defineConfig({
main: {
root: './src/main',
source: { entry: { index: './index.ts' } },
},
preload: {
root: './src/preload',
source: { entry: { index: './index.ts' } },
},
renderer: {
root: './src/renderer',
source: { entry: { index: './index.ts' } },
},
});Each of main / preload / renderer is a full Rsbuild config. See the configuration guide for details.
Start from a learning example in this repository:
| Example | Description |
|---|---|
| vanilla | Minimal Main / Preload / Renderer app |
| react | React renderer with @rsbuild/plugin-react |
cd examples/vanilla
pnpm install
pnpm devFull walkthrough: Getting Started.