With bundleCEF: true on Windows, the packaged app contains 13 Chromium files twice: once in bin/ and again in bin/cef/. The copies are byte-identical (same SHA-256) and add 341,077,751 bytes, 41% of the unpacked app (835,899,353 bytes). Removing one copy of each leaves an app that still starts and renders with CEF.
Versions: Electrobun 2.0.4 (Hutch 0.28.1, as downloaded by electrobun build), Windows 11 x64, Bun main process.
Reproduction
electrobun.config.ts:
import type { ElectrobunConfig } from "electrobun";
export default {
app: { name: "CefDup", identifier: "com.example.cefdup", version: "1.0.0" },
build: {
bun: { entrypoint: "src/bun/index.ts" },
win: { bundleCEF: true, defaultRenderer: "cef" },
},
} satisfies ElectrobunConfig;src/bun/index.ts:
import { BrowserWindow } from "electrobun/main";
new BrowserWindow({ title: "CefDup", url: "https://example.com" });bun add -d electrobun@2.0.4
bunx electrobun build --env=stableThen list the files in build/stable-win-x64/CefDup/Resources/*.tar.zst, or install the app and look in %LOCALAPPDATA%\com.example.cefdup\stable\app\bin.
Building exactly this project gives the same 13 duplicated files and 341,077,751 duplicated bytes (835,896,831 bytes unpacked).
Expected: each Chromium file appears once.
Actual: these 13 files appear in both bin/ and bin/cef/, with identical contents:
| File | Bytes |
|---|---|
| libcef.dll | 264,985,600 |
| dxcompiler.dll | 25,692,672 |
| resources.pak | 14,617,786 |
| icudtl.dat | 10,822,192 |
| libGLESv2.dll | 7,839,744 |
| vk_swiftshader.dll | 5,443,072 |
| d3dcompiler_47.dll | 4,741,480 |
| chrome_elf.dll | 2,546,176 |
| dxil.dll | 1,503,600 |
| vulkan-1.dll | 939,520 |
| chrome_100_percent.pak | 726,813 |
| v8_context_snapshot.bin | 715,800 |
| libEGL.dll | 503,296 |
The installer also leaves the extracted package in a self-extraction folder beside the installed app, so the 341 MB lands on disk twice after install. The setup zip was 290 MB for a one-window app.
Where the extra copy seems to come from
- The release asset
electrobun-cef-win-x64.tar.gz(v2.0.4) has these files only undercef/, so the build step adds the copies inbin/. - At runtime,
nativeWrapper.cppchecks forlibcef.dllandicudtl.datnext to the executable (isCEFAvailable) and pointsresources_dir_pathatbin\cef(around line 6972). So the DLLs are needed inbin/and the.pakfiles inbin/cef/. The other copy of each looks unused. - The extractor's
fixCefSymlinkslooks like the Linux answer to the same layout. It also runs on Windows, where it tries to linklibcef.soand logsWarning: Could not create symlink for libcef.so: error.PermissionDenied.
Check that one copy is unused
In the installed app I deleted the nine DLLs, icudtl.dat and v8_context_snapshot.bin from bin/cef/, and both .pak files from bin/, removing 341,077,751 bytes. The app still started with CEF (user agent Chrome/147.0.0.0) and rendered a 2,000-row test page identically on two launches.
What I did not check: whether some code path, such as GPU fallback, devtools or another locale, reads a deleted copy. Also not checked: whether macOS or Linux builds have the same duplication.
Activity
0No activity yet.