diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 622b8cd9f86..ce894d23248 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -118,13 +118,10 @@ In PowerShell, use `$env:ORCA_DEV_MAIN_SOURCEMAPS='0'` before `pnpm dev`. Remove the variable when debugging the main process with source maps. Renderer and preload settings are unaffected; production builds always keep their hidden main maps. -To try Vite's experimental bundled dev mode for the renderer, set `ORCA_DEV_BUNDLED=1` -before `pnpm dev` (PowerShell: `$env:ORCA_DEV_BUNDLED='1'`). The renderer is served as a -few bundled chunks instead of thousands of module requests, so the first render and full -reloads are faster. HMR still works, but each edit rebuilds the affected chunks. While a -rebuild is pending, a newly opened pop-out, space, or web window may get placeholder HTML -until the bundle is ready. The mode is opt-in and experimental. Unset the variable if the renderer -misbehaves, and report the problem with the variable noted. +`pnpm dev` serves the renderer with Vite's bundled dev mode: a few bundled chunks instead of +thousands of module requests, so the first render and full reloads are faster. While a rebuild is +pending, a newly opened pop-out, space, or web window may briefly get placeholder HTML. If the +renderer misbehaves, set `ORCA_DEV_BUNDLED=0` (PowerShell: `$env:ORCA_DEV_BUNDLED='0'`) and report it. Local installs use pnpm's global virtual store: each package version is one slot under `~/pnpm/store` that every worktree links to, instead of a full `node_modules` per worktree. diff --git a/config/build-plugins/renderer-bundled-dev.ts b/config/build-plugins/renderer-bundled-dev.ts index 22feecf7f08..0c230dd89f1 100644 --- a/config/build-plugins/renderer-bundled-dev.ts +++ b/config/build-plugins/renderer-bundled-dev.ts @@ -1,7 +1,7 @@ import type { UserConfig } from 'electron-vite' /** - * Opt-in (`ORCA_DEV_BUNDLED=1`): Vite's experimental bundled dev mode serves the renderer as + * Default in dev (opt out with `ORCA_DEV_BUNDLED=0`): Vite's bundled dev mode serves the renderer as * bundled chunks instead of thousands of per-module requests, which shortens dev startup and reloads. */ export function withBundledRendererDev( @@ -9,7 +9,7 @@ export function withBundledRendererDev( env: NodeJS.ProcessEnv = process.env ): UserConfig { const renderer = config.renderer - if (env.ORCA_DEV_BUNDLED !== '1' || !renderer || typeof renderer === 'function') { + if (env.ORCA_DEV_BUNDLED === '0' || !renderer || typeof renderer === 'function') { return config } const rollupOptions = renderer.build?.rollupOptions diff --git a/config/scripts/electron-vite-output-contract.test.ts b/config/scripts/electron-vite-output-contract.test.ts index 77e02836261..7ff5e5699eb 100644 --- a/config/scripts/electron-vite-output-contract.test.ts +++ b/config/scripts/electron-vite-output-contract.test.ts @@ -110,10 +110,13 @@ describe('Electron Vite output contract', () => { it('can skip main source maps during development without changing build output settings', () => { try { vi.stubEnv('ORCA_DEV_MAIN_SOURCEMAPS', undefined) + vi.stubEnv('ORCA_DEV_BUNDLED', undefined) const defaults = configureElectronVite({ command: 'serve', mode: 'development' }) expect(defaults.main?.build?.sourcemap).toBe('hidden') expect(defaults.main?.build?.minify).toBe(false) + expect(defaults.renderer?.experimental?.bundledDev).toBe(true) vi.stubEnv('ORCA_DEV_MAIN_SOURCEMAPS', '0') + vi.stubEnv('ORCA_DEV_BUNDLED', '0') const development = configureElectronVite({ command: 'serve', mode: 'development' }) expect(development.main?.build?.sourcemap).toBe(false) expect(development.main?.build?.minify).toBe(false)