Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump Electron to latest and enable native ESM
This commit bumps Electron (`electron`) and dependencies in its ecosystem (`electron-builder` and `electron-log`) to their latest versions. It also adjusts the build configuration to enable native Electron ESM support rather than relying on the bundler. Key changes: - Bump Electron to latest v29. Electron v28 ships with native ESM/ECMAScript modules support. Details on Electron ESM support: - electron/electron$21457 - electron/electron$37535 - Bump `electron-builder` to latest v24.13. `electron-builder` is used to package and publish the application. It supports ESM since 24.10. Details on `electron-builder` ESM support: - electron-userland/electron-builder$7936 - electron-userland/electron-builder$7935 - Bump `electron-log` to latest v5.1. `electron-log` supports ESM since version 5.0.4. Details on `electron-log` ESM support: - megahertz/electron-log$390. Other supporting changes: - Add type hint for electron-builder configuration file. - Update import statements for `electron-updater` as it still is a CommonJS module and does not support ESM. Details: electron-userland/electron-builder$7976 - In `electron-builder` configuration, dynamically locate index file to accommodate different index file extensions outputted from bundling process such as `.js`, `.mjs` and `.cjs` to enable easier future changes. - Remove Electron process specific module alias registration as the workaround is no longer necessary as it's fixed in mainstream. See alex8088/electron-vite$372. TODO: Not done yet - With native Electron ESM support, Electron ESM loader cannot correctly resolve subpath modules. As a workaround, let `electron-vite` bundle `electron-log` so import from `electron-log/main` can be used. Details on workaround: alex8088/electron-vite$401 Details on Electron problem: electron/electron$41241
- Loading branch information