Skip to content
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

chore: optimize package size #1396

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .yarn/versions/5c772db8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
releases:
"@fluent-wallet/cfx_send-transaction": patch
"@fluent-wallet/cfx_sign-transaction": patch
"@fluent-wallet/cfx_sign-tx-with-ledger-nano-s": patch
"@fluent-wallet/eth_send-transaction": patch
"@fluent-wallet/eth_sign-transaction": patch
"@fluent-wallet/eth_sign-tx-with-ledger-nano-s": patch
"@fluent-wallet/ledger": patch
"@fluent-wallet/wallet_import-hardware-wallet-account-group-or-account": patch
"@fluent-wallet/wallet_send-transaction": patch
"@fluent-wallet/wallet_send-transaction-with-action": patch
browser-extension: patch
helios: patch
helios-background: patch
helios-popup: patch
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
"build:chrome": "cross-env NODE_ENV=production cross-env TARGET_BROWSER=chrome webpack --config ./scripts/webpack.config.prod.mjs",
"build:firefox": "cross-env NODE_ENV=production cross-env TARGET_BROWSER=firefox webpack --config ./scripts/webpack.config.prod.mjs",
"build:edge": "cross-env NODE_ENV=production cross-env TARGET_BROWSER=edge webpack --config ./scripts/webpack.config.prod.mjs",
"build": "yarn build:chrome && yarn build:firefox && yarn build:edge"
"build": "yarn build:chrome && yarn build:firefox && yarn build:edge && yarn removeEmptyFile",
"removeEmptyFile": "rm -rf ./dist/*/manifest.js"
},
"devDependencies": {
"@babel/core": "7.17.9",
Expand Down
2 changes: 1 addition & 1 deletion packages/ledger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dependencies": {
"@fluent-wallet/base32-address": "workspace:packages/base32-address",
"@fluent-wallet/hw-app-conflux": "0.0.8",
"@ledgerhq/hw-app-eth": "6.38.0",
"@ledgerhq/hw-app-eth": "6.24.1",
"@ledgerhq/hw-transport-webusb": "6.29.2"
}
}
1 change: 1 addition & 0 deletions scripts/webpack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ const defaultConfig = {
},
alias: {
'/images': path.join(packagesPath, 'browser-extension/images'),
"js-conflux-sdk": path.join(path.resolve(), './node_modules/js-conflux-sdk'),
},
},
plugins: [
Expand Down
5 changes: 5 additions & 0 deletions scripts/webpack.config.dev.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ const devConfig = {
mode: 'development',
devtool: 'inline-cheap-module-source-map',
watch: true,
output: isFirefox
? {
chunkFormat: 'array-push',
}
: undefined,
plugins: [
new Dotenv({
prefix: 'import.meta.env.',
Expand Down
10 changes: 10 additions & 0 deletions scripts/webpack.config.prod.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ const isFirefox = process.env.TARGET_BROWSER === 'firefox'
const prodConfig = {
mode: 'production',
devtool: false,
performance: {
maxEntrypointSize: 2500000,
maxAssetSize: 2500000,
},
output: isFirefox
? {
chunkFormat: 'array-push',
}
: undefined,
plugins: [
new MiniCssExtractPlugin(),
new Dotenv({
Expand All @@ -23,6 +32,7 @@ const prodConfig = {
// new BundleAnalyzerPlugin(),
],
optimization: {
minimize: true,
minimizer: [
new EsbuildPlugin({
target: 'esnext', // Syntax to transpile to (see options below for possible values)
Expand Down
Loading
Loading