Configuration
Rselectron automatically discovers a config file named rselectron.config.{ts,js,mts,mjs,cts,cjs} at the project root. Pass an explicit config path to use another filename. Loading delegates to Rsbuild’s config loader (auto by default; see CLI for --config-loader).
Rselectron configuration is declared with defineConfig. The outer shape has three process keys — main, preload, and renderer — plus an optional top-level electron block for application launch and discovery.
Each process key is a full Rsbuild configuration, extended with Rselectron-owned electron options for that process. Look up shared Rsbuild fields in the Rsbuild docs and use Processes, Electron, and Environment for Rselectron increments.
Minimal example
Config as a function
defineConfig also accepts a function. It receives { command, mode, envMode }:
Use envMode when composing env-aware options; file loading still follows Environment.
Composing configs
There is no implicit shared block. To reuse pieces across processes, compose explicitly:
mergeRselectronConfig— merge outer process keys and application-levelelectronmergeRsbuildConfig— merge within one process’s Rsbuild surface (preserves Rsbuild plugin / function merge rules)

