Skip to content

Commit 180d03a

Browse files
authored
[common-v2.1.7-alpha.2, core-v2.6.0-alpha.3, react-v2.2.5-alpha.3, vue-v2.1.5-alpha.3]: Enhancement: Minify bundle size (#1155)
* minify common * minify core * package bum * package bump * package bump
1 parent 183ce59 commit 180d03a

File tree

6 files changed

+41
-11
lines changed

6 files changed

+41
-11
lines changed

packages/common/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/common",
3-
"version": "2.1.7-alpha.1",
3+
"version": "2.1.7-alpha.2",
44
"description": "Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -73,6 +73,7 @@
7373
"prettier-plugin-svelte": "^2.4.0",
7474
"rollup": "^2.3.4",
7575
"rollup-plugin-svelte": "^7.0.0",
76+
"rollup-plugin-terser": "^7.0.2",
7677
"svelte": "^3.42.5",
7778
"svelte-check": "^2.2.6",
7879
"svelte-preprocess": "^4.9.4",

packages/common/rollup.config.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ import replace from '@rollup/plugin-replace'
44
import json from '@rollup/plugin-json'
55
import sveltePreprocess from 'svelte-preprocess'
66
import typescript from '@rollup/plugin-typescript'
7+
import { terser } from 'rollup-plugin-terser'
78

89
const production = !process.env.ROLLUP_WATCH
910

1011
export default {
1112
input: 'src/index.ts',
1213
output: {
1314
format: 'esm',
14-
dir: 'dist/'
15+
dir: 'dist/',
16+
sourcemap: true,
1517
},
1618
plugins: [
1719
json(),
@@ -33,6 +35,18 @@ export default {
3335
typescript({
3436
sourceMap: !production,
3537
inlineSources: !production
38+
}),
39+
production && terser({
40+
ecma: 2020,
41+
mangle: { toplevel: true },
42+
compress: {
43+
module: true,
44+
toplevel: true,
45+
unsafe_arrows: true,
46+
drop_console: production,
47+
drop_debugger: production
48+
},
49+
output: { quote_style: 1 }
3650
})
3751
],
3852
external: ['joi', 'rxjs', 'ethers', '@ethereumjs/common']

packages/core/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/core",
3-
"version": "2.6.0-alpha.2",
3+
"version": "2.6.0-alpha.3",
44
"description": "Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardized spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -75,13 +75,14 @@
7575
"prettier-plugin-svelte": "^2.4.0",
7676
"rollup": "^2.3.4",
7777
"rollup-plugin-svelte": "^7.0.0",
78+
"rollup-plugin-terser": "^7.0.2",
7879
"svelte-check": "^2.2.6",
7980
"svelte-preprocess": "^4.9.4",
8081
"tslib": "^2.0.0",
8182
"typescript": "^4.5.5"
8283
},
8384
"dependencies": {
84-
"@web3-onboard/common": "^2.1.7-alpha.1",
85+
"@web3-onboard/common": "^2.1.7-alpha.2",
8586
"bignumber.js": "^9.0.0",
8687
"bnc-sdk": "^4.4.1",
8788
"bowser": "^2.11.0",

packages/core/rollup.config.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ import json from '@rollup/plugin-json'
55
import sveltePreprocess from 'svelte-preprocess'
66
import typescript from '@rollup/plugin-typescript'
77
import copy from '@rollup-extras/plugin-copy'
8+
import { terser } from 'rollup-plugin-terser'
89

910
const production = !process.env.ROLLUP_WATCH
1011

1112
export default {
1213
input: 'src/index.ts',
1314
output: {
1415
format: 'es',
15-
dir: 'dist/'
16+
dir: 'dist/',
17+
sourcemap: true,
1618
},
1719
plugins: [
1820
json(),
@@ -38,6 +40,18 @@ export default {
3840
copy({
3941
src: 'src/i18n/en.json',
4042
dest: 'i18n'
43+
}),
44+
production && terser({
45+
ecma: 2020,
46+
mangle: { toplevel: true },
47+
compress: {
48+
module: true,
49+
toplevel: true,
50+
unsafe_arrows: true,
51+
drop_console: production,
52+
drop_debugger: production
53+
},
54+
output: { quote_style: 1 }
4155
})
4256
],
4357
external: [

packages/react/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/react",
3-
"version": "2.2.5-alpha.1",
3+
"version": "2.2.5-alpha.3",
44
"description": "A collection of React hooks for integrating Web3-Onboard in to React and Next.js projects. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -62,8 +62,8 @@
6262
"typescript": "^4.5.5"
6363
},
6464
"dependencies": {
65-
"@web3-onboard/core": "^2.6.0-alpha.2",
66-
"@web3-onboard/common": "^2.1.7-alpha.1",
65+
"@web3-onboard/core": "^2.6.0-alpha.3",
66+
"@web3-onboard/common": "^2.1.7-alpha.2",
6767
"use-sync-external-store": "1.0.0"
6868
},
6969
"peerDependencies": {

packages/vue/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@web3-onboard/vue",
3-
"version": "2.1.5-alpha.1",
3+
"version": "2.1.5-alpha.3",
44
"description": "A collection of Vue Composables for integrating Web3-Onboard in to a Vue or Nuxt project. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.",
55
"keywords": [
66
"Ethereum",
@@ -62,8 +62,8 @@
6262
"dependencies": {
6363
"@vueuse/core": "^8.4.2",
6464
"@vueuse/rxjs": "^8.2.0",
65-
"@web3-onboard/common": "^2.1.7-alpha.1",
66-
"@web3-onboard/core": "^2.6.0-alpha.2",
65+
"@web3-onboard/common": "^2.1.7-alpha.2",
66+
"@web3-onboard/core": "^2.6.0-alpha.3",
6767
"vue-demi": "^0.12.4"
6868
},
6969
"peerDependencies": {

0 commit comments

Comments
 (0)