-
-
Notifications
You must be signed in to change notification settings - Fork 255
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
WIP: bundle main+preload as ES #15544
Draft
Lemonexe
wants to merge
4
commits into
develop
Choose a base branch
from
chore/bump-electron-store
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+109
−74
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,17 +74,18 @@ const config: webpack.Configuration = { | |
|
||
return '[name].js'; | ||
}, | ||
module: true, | ||
path: dist, | ||
publicPath: './', | ||
library: { type: 'umd' }, | ||
library: { type: 'module' }, | ||
}, | ||
externals: [ | ||
...dependencies, | ||
...devDependencies, | ||
'bufferutil', // optional dependency of ws lib | ||
'memcpy', // optional depencency of bytebuffer lib | ||
'utf-8-validate', // optional dependency of ws lib | ||
'osx-temperature-sensor', // optional dependency of systeminformation lib | ||
// 'bufferutil', // optional dependency of ws lib | ||
// 'memcpy', // optional depencency of bytebuffer lib | ||
// 'utf-8-validate', // optional dependency of ws lib | ||
// 'osx-temperature-sensor', // optional dependency of systeminformation lib | ||
], | ||
module: { | ||
rules: [ | ||
|
@@ -112,6 +113,8 @@ const config: webpack.Configuration = { | |
alias: { | ||
'@emurgo/cardano-serialization-lib-nodejs': '@emurgo/cardano-serialization-lib-browser', | ||
'@trezor/connect$': '@trezor/connect/src/index', // alternative for "module": "src/index" in connect's package.json | ||
// optional dependency of systeminformation lib mocked as undefined (webpack needs it when targetting ES) | ||
'osx-temperature-sensor': false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unlike other deps in |
||
}, | ||
}, | ||
performance: { | ||
|
@@ -171,7 +174,10 @@ const config: webpack.Configuration = { | |
// Unfortunately Cardano Serialization Lib triggers webpack warning: | ||
// "Critical dependency: the request of a dependency is an expression" due to require in generated wasm module | ||
// https://github.com/Emurgo/cardano-serialization-lib/issues/119 | ||
experiments: { asyncWebAssembly: true }, | ||
experiments: { | ||
asyncWebAssembly: true, | ||
outputModule: true, | ||
}, | ||
ignoreWarnings: [{ module: /cardano-serialization-lib-browser/ }], | ||
}; | ||
|
||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"name": "@trezor/suite-desktop", | ||
"description": "Trezor Suite desktop application", | ||
"type": "module", | ||
"version": "1.0.0", | ||
"private": true, | ||
"author": "SatoshiLabs <[email protected]>", | ||
|
@@ -16,15 +17,15 @@ | |
"build:core": "yarn workspace @trezor/suite-desktop-core run build:core", | ||
"build:app": "NODE_ENV=production yarn build:core", | ||
"build:app:dev": "NODE_ENV=development yarn build:core", | ||
"build:app:electron": "yarn electron-builder --config electron-builder-config.js", | ||
"build:app:electron": "yarn electron-builder --config electron-builder-config.cjs", | ||
"build:linux": "yarn clean && yarn build:ui && yarn build:app && yarn build:app:electron --publish never --linux --x64 --arm64", | ||
"build:mac": "yarn clean && yarn build:ui && yarn build:app && yarn build:app:electron --publish never --mac --x64 --arm64", | ||
"build:win": "yarn clean && yarn build:ui && yarn build:app && yarn build:app:electron --publish never --win --x64" | ||
}, | ||
"dependencies": { | ||
"blake-hash": "^2.0.0", | ||
"electron-localshortcut": "^3.2.1", | ||
"electron-store": "8.2.0", | ||
"electron-store": "10.0.0", | ||
"electron-updater": "6.3.9", | ||
"usb": "^2.14.0" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
These are all sub-dependencies that are only optionally required by our dependencies, example.
When specified in
externals
, webpack will try to provide them, but it crashes at run time when output target is ES. I don't know if any actual suite functionality relies on those libs.