mirror of
https://github.com/waku-org/js-waku.git
synced 2025-01-11 13:04:41 +00:00
feat: remove umd build, minimize esm bundle
This commit is contained in:
parent
c4f1d90c7b
commit
50890b5206
@ -26,8 +26,7 @@
|
||||
"build": "rimraf ./dist; run-s build:**",
|
||||
"build:esm": "tsc && node build-scripts/fix-imports.js",
|
||||
"build:bundle": "rollup --config rollup.config.js -- dist/esm/index.js",
|
||||
"build:umd": "webpack --config webpack.umd.config.cjs",
|
||||
"build:umd:min": "terser --ecma 6 --compress --mangle -o dist/umd/index.min.js -- dist/umd/index.js && gzip -9 -c dist/umd/index.min.js > dist/umd/index.min.js.gz",
|
||||
"build:bundle:min": "terser --ecma 11 --compress --mangle -o dist/bundle.min.js -- dist/bundle.js && gzip -9 -c dist/bundle.min.js > dist/bundle.min.js.gz",
|
||||
"size": "npm run build && size-limit",
|
||||
"fix": "run-s fix:*",
|
||||
"fix:prettier": "prettier \"src/**/*.ts\" \"./*.json\" \"*.*js\" \".github/**/*.yml\" --write",
|
||||
@ -155,7 +154,6 @@
|
||||
},
|
||||
"files": [
|
||||
"dist/esm",
|
||||
"dist/umd",
|
||||
"src/*.ts",
|
||||
"src/lib/**/*.ts",
|
||||
"src/proto/**/*.ts",
|
||||
|
@ -1,40 +0,0 @@
|
||||
const webpack = require("webpack");
|
||||
const path = require("path");
|
||||
|
||||
module.exports = {
|
||||
mode: "production",
|
||||
entry: {
|
||||
"js-waku": "./src/index.ts",
|
||||
},
|
||||
devtool: "inline-source-map",
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.ts$/,
|
||||
use: "ts-loader",
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
],
|
||||
},
|
||||
plugins: [
|
||||
new webpack.ProvidePlugin({
|
||||
process: "process/browser.js",
|
||||
Buffer: ["buffer", "Buffer"],
|
||||
}),
|
||||
],
|
||||
resolve: {
|
||||
extensions: [".ts", ".js"],
|
||||
fallback: {
|
||||
buffer: require.resolve("buffer/"),
|
||||
crypto: false,
|
||||
stream: require.resolve("stream-browserify"),
|
||||
},
|
||||
},
|
||||
output: {
|
||||
filename: "index.js",
|
||||
path: path.resolve(__dirname, "dist/umd"),
|
||||
library: "waku",
|
||||
libraryTarget: "umd",
|
||||
globalObject: "this",
|
||||
},
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user