mirror of https://github.com/waku-org/js-waku.git
fix: size-limit by setting buffer false in webpack
This commit is contained in:
parent
69b3595d6f
commit
bf47803631
|
@ -0,0 +1,52 @@
|
|||
const modifyWebpackConfig = (webpackConfig) => {
|
||||
if (!webpackConfig.resolve) webpackConfig.resolve = {};
|
||||
if (!webpackConfig.resolve.fallback) webpackConfig.resolve.fallback = {};
|
||||
// Can be removed once https://github.com/libp2p/js-libp2p-pubsub/pull/92 is merged and released
|
||||
webpackConfig.resolve.fallback.buffer = false;
|
||||
return webpackConfig;
|
||||
};
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
name: "Waku core",
|
||||
path: "dist/bundle.min.js",
|
||||
import: "{ Waku }",
|
||||
modifyWebpackConfig,
|
||||
},
|
||||
{
|
||||
name: "Waku default setup",
|
||||
path: "dist/bundle.min.js",
|
||||
import: "{ createWaku, waitForRemotePeer }",
|
||||
modifyWebpackConfig,
|
||||
},
|
||||
{
|
||||
name: "Asymmetric, symmetric encryption and signature",
|
||||
path: "dist/bundle.min.js",
|
||||
import: "{ waku_message }",
|
||||
modifyWebpackConfig,
|
||||
},
|
||||
{
|
||||
name: "DNS discovery",
|
||||
path: "dist/bundle.min.js",
|
||||
import: "{ discovery }",
|
||||
modifyWebpackConfig,
|
||||
},
|
||||
{
|
||||
name: "Privacy preserving protocols",
|
||||
path: "dist/bundle.min.js",
|
||||
import: "{ WakuRelay }",
|
||||
modifyWebpackConfig,
|
||||
},
|
||||
{
|
||||
name: "Light protocols",
|
||||
path: "dist/bundle.min.js",
|
||||
import: "{ WakuLightPush, WakuFilter }",
|
||||
modifyWebpackConfig,
|
||||
},
|
||||
{
|
||||
name: "History retrieval protocols",
|
||||
path: "dist/bundle.min.js",
|
||||
import: "{ WakuStore }",
|
||||
modifyWebpackConfig,
|
||||
},
|
||||
];
|
|
@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
### Fix
|
||||
|
||||
- size-limit config to test several usages of Waku.
|
||||
- `buffer` is not needed in the browser.
|
||||
|
||||
## [0.24.0] - 2022-05-27
|
||||
|
||||
|
|
38
package.json
38
package.json
|
@ -57,6 +57,7 @@
|
|||
"reset-hard": "git clean -dfx && git reset --hard && npm i && npm run build && for d in examples/*/; do (cd $d; npm i); done"
|
||||
},
|
||||
"browser": {
|
||||
"buffer": false,
|
||||
"crypto": false
|
||||
},
|
||||
"engines": {
|
||||
|
@ -163,43 +164,6 @@
|
|||
"**/*.spec.js"
|
||||
]
|
||||
},
|
||||
"size-limit": [
|
||||
{
|
||||
"name": "Waku core",
|
||||
"path": "dist/bundle.min.js",
|
||||
"import": "{ Waku }"
|
||||
},
|
||||
{
|
||||
"name": "Waku default setup",
|
||||
"path": "dist/bundle.min.js",
|
||||
"import": "{ createWaku, waitForRemotePeer }"
|
||||
},
|
||||
{
|
||||
"name": "Asymmetric, symmetric encryption and signature",
|
||||
"path": "dist/bundle.min.js",
|
||||
"import": "{ waku_message }"
|
||||
},
|
||||
{
|
||||
"name": "DNS discovery",
|
||||
"path": "dist/bundle.min.js",
|
||||
"import": "{ discovery }"
|
||||
},
|
||||
{
|
||||
"name": "Privacy preserving protocols",
|
||||
"path": "dist/bundle.min.js",
|
||||
"import": "{ WakuRelay }"
|
||||
},
|
||||
{
|
||||
"name": "Light protocols",
|
||||
"path": "dist/bundle.min.js",
|
||||
"import": "{ WakuLightPush, WakuFilter }"
|
||||
},
|
||||
{
|
||||
"name": "History retrieval protocols",
|
||||
"path": "dist/bundle.min.js",
|
||||
"import": "{ WakuStore }"
|
||||
}
|
||||
],
|
||||
"lint-staged": {
|
||||
"*.ts": [
|
||||
"eslint --fix"
|
||||
|
|
Loading…
Reference in New Issue