-
-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable support for ES modules #14482
Comments
Status report: TL;DR: tried many things, invested a lot of effort, but did not come up with a viable solution yet ❌ Electron-store + CJSOriginal problem: it's incompatible, as stated. Build runs fine, but in runtime, the electron-main script throws ❌ Webpack + ESMWIP in #15544 Rspack exploration workAn emerging bundler that seeks to reimplement webpack in rust, being mostly compatible. They claim that projects with simple config can replace Webpack with Rspack 1:1 with almost no effort. 💭 🤔 Maybe, just maybe, ESM could work better in Rspack? Also, it could significantly improve DX - much faster initial dev bundle + HMR 😍 But in Trezor Suite, our webpack config is very complex. It required a considerable effort. I've made it work for main+preload with CJS, but I have not finished renderer.. See #16017 The peformance benefits do look promising, about 50% quicker for dev builds. Conclusion: I couldn't make Rspack work, and see no clear path forward. It was a lot of effort, but personally I'd write it off as sunken costs 😢 |
Configure Electron build process to output
main
andpreload
bundles as ES instead of CommonJS.That is possible since electron 28.0.0.
It is needed to upgrade dependencies which do not support CommonJS anymore:
The text was updated successfully, but these errors were encountered: