It's for my own modules, but maybe you can find it useful too. It changes often (but follows semver). Unannounced PRs generally not welcome, but feel free to open issues to discuss first.
It outputs the following files:
"main": "dist/[lib-name].common-js.js",in package.json
"module": "dist/[lib-name].es-modules.js",in package.json
Install it in your project:
npm install --save-dev bfred-npm-bundler
Add the references to the generated files and the build step in your
If your lib only makes sense inside node/browserify, you can skip the
browser file creation by not passing the second argument:
bfred-npm-bundler lib-name instead of
bfred-npm-bundler lib-name libName
browser file is useful to be used for byte-counting via
gzip-size-cli or with badges. If your package is node-only, you can pass the option
--byte-count and a dist/[lib-name].size-measuring-only.js file will be created.
rollup-babel-lib-bundler is more configurable
MIT © Federico Brigante