mirror of
https://github.com/zadam/trilium.git
synced 2026-09-14 11:06:04 +05:00
The main process now builds as main.mjs with dynamic-import boundaries split into chunks/ that only load on first use; dist/package.json points Electron at the new entry. The preload stays CJS (Electron's sandboxed renderer cannot load ESM preloads) and image_worker.cjs stays CJS (spawned by its path). The ESM banner now resolves __dirname in a chunk to the bundle root rather than chunks/: bundled code uses __dirname to find siblings of the entry (preload.cjs, image_worker.cjs, getResourceDir), and which chunk a module lands in must not change what the path means. Verified by launching the built app: the renderer loads over trilium-app:// and reaches the backend through the preload bridge. Main-process RSS on identical boots: 348 MB (CJS) -> 287 MB (ESM). The "Error executing query" lines at boot predate this change (identical under CJS). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| icon-packs | ||
| icons | ||
| repo-migration | ||
| translation | ||
| analyze-perf.ts | ||
| build-portable-better-sqlite3.sh | ||
| build-utils.ts | ||
| check-version-consistency.ts | ||
| electron-run-prod.mts | ||
| electron-start.mts | ||
| filter-tsc-output.mts | ||
| release-notes-body.mts | ||
| release-notes-body.spec.ts | ||
| tsconfig.json | ||
| update-build-info.ts | ||
| update-contributors.ts | ||
| update-flake-electron.spec.ts | ||
| update-flake-electron.ts | ||
| update-nightly-version.ts | ||
| update-version.ts | ||
| utils.mts | ||
| vitest.config.ts | ||
| wipe-node-modules.mts | ||