npm install rollingRollup and Webpack are bundlers for different purposes, I mainly use Webpack to bundle web apps, and use Rollup to bundle JavaScript libraries. Using Rollup to bundle libraries ends up with clean, smaller, readable code, so just try it out!
``bash`
$ npm install -g rolling
Build:
`bash./src/index.jsit looks for
by default./dist/bundle.jsand outputs bundled file to
$ rolling src.js --out bundle.js
Watch input:
Currently Rollup does not support incremental builds, so use any
watch utility to do this for now, such as onchange:`bash
$ npm install -g onchange
$ onchange ./src -- rolling
`Help:
`bash
$ rolling --help
`Babel:
If you use some ES2015+ features that require
babel-runtime, install it in your project:`bash
$ cd my-project
$ npm install babel-runtime --save
`API
`javascript
import {build, watch} from 'rolling'const options = {
input: ...,
output: ...
// more configs go here
}
build(options).catch(e => console.log(e.stack))
// or
watch(options).catch(e => console.log(e.stack))
``MIT © EGOIST