mirror of https://github.com/waku-org/js-waku.git
Use rollup instead of tsc to generate cjs files
This commit is contained in:
parent
ebbb0a2713
commit
e3b6292a6e
|
@ -7,7 +7,7 @@
|
|||
".": {
|
||||
"types": "./dist/esm/index.d.ts",
|
||||
"import": "./dist/esm/index.js",
|
||||
"require": "./dist/cjs/index.js"
|
||||
"require": "./dist/cjs/index.cjs"
|
||||
}
|
||||
},
|
||||
"type": "module",
|
||||
|
@ -24,8 +24,8 @@
|
|||
"scripts": {
|
||||
"prepare": "husky install",
|
||||
"build": "rimraf ./dist; run-s build:**",
|
||||
"build:cjs": "tsc --module commonjs --outDir dist/cjs",
|
||||
"build:esm": "tsc && node build-scripts/fix-imports.js",
|
||||
"build:cjs": "rollup --config rollup.cjs.config.js -- dist/esm/index.js",
|
||||
"build:umd": "rollup --config rollup.config.js -- dist/esm/index.js",
|
||||
"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:esm && size-limit",
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
import { nodeResolve } from "@rollup/plugin-node-resolve";
|
||||
import commonjs from "@rollup/plugin-commonjs";
|
||||
import json from "@rollup/plugin-json";
|
||||
import nodePolyfills from "rollup-plugin-polyfill-node";
|
||||
|
||||
export default {
|
||||
output: {
|
||||
file: "dist/cjs/index.cjs",
|
||||
format: "cjs",
|
||||
},
|
||||
plugins: [
|
||||
commonjs(),
|
||||
json(),
|
||||
nodePolyfills(),
|
||||
nodeResolve({
|
||||
browser: true,
|
||||
preferBuiltins: false,
|
||||
}),
|
||||
],
|
||||
};
|
Loading…
Reference in New Issue