-
Notifications
You must be signed in to change notification settings - Fork 33
convert from CJS to ESM #712
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
base: develop
Are you sure you want to change the base?
Conversation
ESM config files support was added in 3.3.0.
package.json
Outdated
"description": "WALLET AND EXCHANGE CLIENT FOR THORCHAIN, MAYACHAIN, CHAINFLIP", | ||
"main": "build/main/electron.js", | ||
"type": "module", | ||
"exports": "build/main/electron.js", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When "type": "module", is added exports": "build/main/electron.js" shows a `String does not match the pattern of "^./". warning.
yarn dev fails
error during start dev server and electron app:
Error: No entry point found for electron app, please add a "main" field to package.json
Could be fixed via
"main": "./build/main/electron.js",
"exports": {
".": "./build/main/electron.js"
},
@dynst getting an error when doing a rebuild:
Not sure why as Either is imported and present. I assume they need to be imported differently in |
ESM asgardex-desktop/electron.vite.config.mjs Line 23 in aae5c1b
https://vite.dev/config/shared-options#resolve-extensions But that field has a decent default, anyway, even if it wasn't set. And it's only applicable to internal files, not for external dependencies. I guess we're not supposed to reach into the
There's a lot of import statements just like this one that bypass the module's official top-level |
It matters now that it's true ESM.
Electron 28 and newer has ESM support now.