Migrate from electron-vite
Rselectron aims for capability parity, not drop-in Vite config renaming. Migrate by semantics. Known parity exceptions (Vite plugins, V8 bytecode, exported SWC helpers) are summarized under Compatibility.
Packages and plugins
Config and environment
Watch and development
API and CLI
Checklist
- Replace Vite plugins with Rsbuild plugins.
- Remove bytecode / SWC-helper usage; handle remaining needs outside Rselectron if required.
- Map each process
rootand entry to Rsbuild config under Configuration. - Point
package.json#mainat the planned Main output under Conventional role outputs (out/main/...whendistPathis unset). - Prefer the Preferred ESM path for
"type": "module"apps: leaveelectron.formatatauto(derived ESM). Drop beta CJS workarounds—forcedformat: 'cjs',externalizeDeps.includelists added only for import-only packages, and defaultwebpackIgnore/ magic-commentimport()interop—once on ESM (Troubleshooting). - Install project-local Electron within the supported peer range (Compatibility).
- Validate with
rselectron inspect, then rundev/build/preview. - Prefer copying from
examples/.

