feat: add esm bundling

This commit is contained in:
Franck Royer 2022-07-26 15:00:24 +10:00 committed by fryorcraken.eth
parent d2703d081e
commit 338e3c9964
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
2 changed files with 3 additions and 2 deletions

View File

@ -25,6 +25,7 @@
"prepare": "husky install",
"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",
"size": "npm run build && size-limit",

View File

@ -5,8 +5,8 @@ import nodePolyfills from "rollup-plugin-polyfill-node";
export default {
output: {
file: "dist/umd/index.js",
format: "umd",
file: "dist/bundle.js",
format: "esm",
name: "waku",
},
plugins: [