Environment
Build mode and environment-file selection are independent. Changing one does not change the other.
CLI details: CLI. In a config function, both appear as { command, mode, envMode } — see Configuration.
How files are loaded
Rselectron loads environment variables through Rsbuild’s environment pipeline (rich result model, not a flattened record). File naming and override order follow Rsbuild environment variables; --env-mode / envMode selects the namespace the same way Rsbuild’s env mode does.
Default public prefixes:
When Rselectron builds a process, it loads the shared prefix plus that process’s scoped prefix via envPrefixesForRole.
Only RSELECTRON_RENDERER_URL is reserved for the development renderer URL. Main and Preload can read it through the rselectron/node type entry on ProcessEnv without application-owned ambient declarations.
Programmatic loading
loadEnv matches CLI --env-mode and defaults to RSELECTRON_ENV_PREFIXES (all four prefixes above). Override prefixes when you need a subset.
envPrefixesForRole('main' | 'preload' | 'renderer') returns the shared RSELECTRON_ prefix plus the process-scoped one.
See JavaScript API for the full loadEnv surface.

