mirror of
https://github.com/fluencelabs/js-libp2p-noise
synced 2025-04-25 01:32:30 +00:00
add bundle analyzer
This commit is contained in:
parent
13e8a9fc9e
commit
347429b6b8
10
package.json
10
package.json
@ -20,6 +20,7 @@
|
||||
"scripts": {
|
||||
"prebuild": "rm -rf lib && rm -rf dist",
|
||||
"build": "yarn run build:node && yarn run build:web && yarn run build:types",
|
||||
"bundle": "webpack --config webpack.bundle.config.js",
|
||||
"build:node": "babel --no-babelrc --config-file ./babel.config.json src --copy-files -x .ts -d dist --source-maps",
|
||||
"build:web": "babel --no-babelrc --config-file ./babel.web.config.json src --copy-files -x .ts -d lib --source-maps",
|
||||
"build:types": "tsc --declaration --outDir dist --emitDeclarationOnly",
|
||||
@ -47,6 +48,7 @@
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@typescript-eslint/eslint-plugin": "^2.6.0",
|
||||
"@typescript-eslint/parser": "^2.6.0",
|
||||
"babel-loader": "^8.1.0",
|
||||
"chai": "^4.2.0",
|
||||
"eslint": "^6.6.0",
|
||||
"karma": "^4.4.1",
|
||||
@ -60,12 +62,12 @@
|
||||
"sinon": "^8.1.0",
|
||||
"ts-loader": "^6.2.1",
|
||||
"typescript": "^3.6.4",
|
||||
"webpack": "^4.41.5"
|
||||
"webpack": "^4.41.5",
|
||||
"webpack-bundle-analyzer": "^3.6.1",
|
||||
"webpack-cli": "^3.3.11"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/bn.js": "^4.11.6",
|
||||
"aead-js": "^0.1.0",
|
||||
"bn.js": "^5.0.0",
|
||||
"buffer": "^5.4.3",
|
||||
"debug": "^4.1.1",
|
||||
"futoin-hkdf": "^1.3.2",
|
||||
@ -75,7 +77,7 @@
|
||||
"it-pair": "^1.0.0",
|
||||
"it-pb-rpc": "^0.1.8",
|
||||
"it-pipe": "^1.1.0",
|
||||
"libp2p-crypto": "^0.17.1",
|
||||
"libp2p-crypto": "^0.17.6",
|
||||
"peer-id": "^0.13.5",
|
||||
"protobufjs": "6.8.8",
|
||||
"tweetnacl": "^1.0.3"
|
||||
|
24
webpack.bundle.config.js
Normal file
24
webpack.bundle.config.js
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
|
||||
|
||||
module.exports = {
|
||||
entry: "./src/index.ts",
|
||||
mode: "production",
|
||||
output: {
|
||||
filename: "../bundle/bundle.js"
|
||||
},
|
||||
node: {
|
||||
fs: "empty"
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".ts", ".js"],
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{test: /\.ts$/, exclude: [/node_modules/], use: {loader: "babel-loader", options: require("./babel.web.config")}}
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new BundleAnalyzerPlugin()
|
||||
]
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user