Multi-process Rollup wrapper.
Rollup has the ability to create multiple bundles from a single invocation of
rollup command. All you need to do is export an array of build
configurations from your configuration file. Great, right?
Well, using this method, a single Rollup process will simply create all the configured bundles in sequence. Unfortunately, that can get pretty slow. Computers are great at parallelization, so what you probably want to do instead is run your builds concurrently.
To accomplish that, you could create a configuration file per build and invoke
rollup once for each of those files. Once you've figured out how to coordinate
all that, you'd probably turn your attention to reporting progress from each of
the builds in a comprehensive way.
What fancy-rollup does is handle all this for you. Firstly, it will start multiple Node processes that each run Rollup, using all of your machine's available processing power and dramatically speeding up builds. Secondly, it comes with multiple reporters that provide a nice overview of build progress.
For convenience, you can install fancy-rollup globally:
yarn global add fancy-rollup
However, you probably want to make it a devDependency of your package instead:
yarn add fancy-rollup --dev
Like Rollup itself, fancy-rollup will read
rollup.config.js in the current
working directory. Just export an array of build configurations and you're good
Simply invoke fancy-rollup from the command line:
||Specify config file name. Identical to Rollup's option.|
||Select targets to build. May be specified multiple times. Default is all.|
||Select style for reporting progress. See below.|
||Limit number of concurrent builds. Default is one per CPU core.|
||Show version number.|
||Tailing logger with progress bar and timer. Default.|
||Tailing logger only. Default for non-TTY environments.|
||Live-updating one-line status.|
||Live-updating checklist using Listr.|
||Rollup output only.|
It's generally a good idea to lock down the version of Rollup that you want to use for bundling. Specifying an exact version lets you avoid API inconsistencies and other unexpected behavior.
This is accomplished by simply installing the correct
rollup package alongside
fancy-rollup. In other words, put both of them in the same
npm install) puts them under the same
If fancy-rollup cannot find
rollup under the package directory's
node_modules, it will check the parent directory's, then that one's parent
directory's, etc. This is Node's standard module resolution in action.
If none of the parent directories contain a
rollup installation either,
fancy-rollup will fall back to using its own version. You can check which one
that is by consulting