bunchee
zero config bundler for js library
Installation
npm install --save-dev bunchee
Usage
CLI
Usage: bunchee [options]
Options:
-v, --version output the version number
-w, --watch watch src files changes
-d, --dest <dir> specify output dest file
-h, --help output usage information
Usage:
$ bunchee ./src/index.js
Dev Dependency
Declare your main field and module field in package.json, then call bunchee cli in build scripts
{
"main": "dist/pkg.cjs.js",
"module": "dist/pkg.esm.js",
"scripts": {
"build": "bunchee ./src/index.js"
}
}
Or use it globally
cd <project-root-dir>
bunchee ./src/index.js