build: reduce webpack size of bip39 (#1747)

* remove non-english wordlists from bip39

* add webpack change to tests

* add bundlephobia badge
This commit is contained in:
Mayukha Vadari
2021-10-18 18:10:14 -04:00
committed by GitHub
parent 42ff3ec6d0
commit 61b2cb7fb6
3 changed files with 9 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
A JavaScript/TypeScript library for interacting with the XRP Ledger A JavaScript/TypeScript library for interacting with the XRP Ledger
[![NPM](https://nodei.co/npm/xrpl.png)](https://www.npmjs.org/package/xrpl) [![NPM](https://nodei.co/npm/xrpl.png)](https://www.npmjs.org/package/xrpl)
![npm bundle size](https://img.shields.io/bundlephobia/min/xrpl)
This is the recommended library for integrating a JavaScript/TypeScript app with the XRP Ledger, especially if you intend to use advanced functionality such as IOUs, payment paths, the decentralized exchange, account settings, payment channels, escrows, multi-signing, and more. This is the recommended library for integrating a JavaScript/TypeScript app with the XRP Ledger, especially if you intend to use advanced functionality such as IOUs, payment paths, the decentralized exchange, account settings, payment channels, escrows, multi-signing, and more.

View File

@@ -27,6 +27,10 @@ function webpackForTest(testFileName) {
plugins: [ plugins: [
new webpack.ProvidePlugin({ process: 'process/browser' }), new webpack.ProvidePlugin({ process: 'process/browser' }),
new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'] }), new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'] }),
new webpack.IgnorePlugin({
resourceRegExp: /^\.\/wordlists\/(?!english)/,
contextRegExp: /bip39\/src$/,
}),
], ],
module: { module: {
rules: [ rules: [

View File

@@ -26,6 +26,10 @@ function getDefaultConfiguration() {
), ),
new webpack.ProvidePlugin({ process: 'process/browser' }), new webpack.ProvidePlugin({ process: 'process/browser' }),
new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'] }), new webpack.ProvidePlugin({ Buffer: ['buffer', 'Buffer'] }),
new webpack.IgnorePlugin({
resourceRegExp: /^\.\/wordlists\/(?!english)/,
contextRegExp: /bip39\/src$/,
}),
], ],
module: { module: {
rules: [], rules: [],