Milady Electrobun Dev
Use when running Electrobun in development mode — electrobun dev, --watch flag, hot reload, CEF devtools, debugging the renderer, or understanding the dev build cycle.
install
source · Clone the upstream repo
git clone https://github.com/milady-ai/milady
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/milady-ai/milady "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/plugins/electrobun-dev/skills/electrobun-dev" ~/.claude/skills/milady-ai-milady-electrobun-dev && rm -rf "$T"
manifest:
.claude/plugins/electrobun-dev/skills/electrobun-dev/SKILL.mdsource content
Electrobun Dev Mode
Commands
electrobun dev # build (dev env) once, then launch app electrobun dev --watch # build, launch, then watch for changes and rebuild+relaunch
Shorthand via package.json (standard templates):
bun start # → electrobun dev bun run dev # → electrobun dev --watch
What Happens on electrobun dev
electrobun dev- Reads
electrobun.config.ts - Downloads any missing native binaries (Bun, launcher, WGPU/CEF if configured)
- Bundles
viabuild.bun.entrypoint
in dev mode (no minify, sourcemaps inline)Bun.build() - Bundles each
entrypointbuild.views.* - Copies
files to build outputbuild.copy - Skips codesign and notarization
- Writes app bundle to
build/dev-<os>-<arch>/ - Launches the app, streaming stdout/stderr to your terminal
Watch Mode (--watch
)
--watchAfter initial build+launch, watch mode monitors:
- Dir containing
build.bun.entrypoint - Dir(s) containing each
entrypointbuild.views.* - Dirs listed in
(extra paths)build.watch - Dirs of files listed in
build.copy
Debounce: 300ms — rapid saves are coalesced into one rebuild.
Ignored automatically:
build/, artifacts/, node_modules/, and patterns in build.watchIgnore.
On change: kills running app → rebuilds → relaunches.
Extra watch paths
// electrobun.config.ts build: { watch: ["src/shared/", "assets/"], watchIgnore: ["src/**/*.test.ts", "src/**/*.spec.ts"], }
CEF DevTools (Chromium inspector)
When using
renderer: "cef" or defaultRenderer: "cef", the CEF renderer exposes Chrome DevTools at:
http://localhost:9222
Open in any Chrome/Chromium browser while the app is running. Lists all active renderer pages — click to inspect.
Note: DevTools are only available in
dev builds. They are not exposed in canary or stable.
Native WebView Debugging (macOS)
For
renderer: "native" (WKWebView), enable the developer extras:
// In src/bun/index.ts — call openDevTools() on the BrowserView instance const view = new BrowserView({ ... }); view.openDevTools(); // Opens Safari Web Inspector (uses private WKWebView _inspector API)
Or in Safari: Develop → [Your App] → [webview name]
Debugging Tips
- Console output: All
from bun-side code appears in the terminal. Renderer-sideconsole.log
only appears in devtools (not terminal).console.log - RPC tracing: Add
to request/message handlers to trace cross-process calls.console.log - Source maps: Dev builds include inline source maps. Stack traces point to
source lines..ts - Slow reload? Add only changed dirs to
rather than broad patterns.build.watch - App not relaunching? If the app process is holding a file lock, kill it manually:
pkill -f "<AppName>"
Build Output (dev)
build/dev-macos-arm64/ └── <AppName>-dev.app/ └── Contents/ ├── MacOS/ │ ├── launcher # native launcher │ └── main.js # bundled bun entrypoint ├── Resources/ │ ├── <viewname>/ # bundled renderer │ └── bun # bun runtime binary └── Info.plist