fancy-rollup
Multi-process Rollup wrapper.
Last updated 4 months ago by timdp .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install fancy-rollup 
SYNC missed versions from official npm registry.

fancy-rollup

npm Dependencies JavaScript Standard Style

Multi-process Rollup wrapper.

Preview

Purpose

Rollup has the ability to create multiple bundles from a single invocation of the 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.

Installation

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

Configuration

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 to go.

Usage

Simply invoke fancy-rollup from the command line:

fancy-rollup

An API for invoking fancy-rollup from your JavaScript code is in the works.

Options

Option Description
<nobr>-c <filename>
--config</nobr>
Specify config file name. Identical to Rollup's option.
<nobr>-t <id>
--target</nobr>
Select targets to build. May be specified multiple times. Default is all.
<nobr>-r <name>
--reporter</nobr>
Select style for reporting progress. See below.
<nobr>-p <number>
--concurrency</nobr>
Limit number of concurrent builds. Default is one per CPU core.
<nobr>-v
--version</nobr>
Show version number.
<nobr>-h
--help</nobr>
Show help.

Reporters

Reporter Description
interactive Tailing logger with progress bar and timer. Default.
dumb Tailing logger only. Default for non-TTY environments.
simple Live-updating one-line status.
list Live-updating checklist using Listr.
essential Rollup output only.
silent No output.

Rollup Versioning

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 package.json file so that yarn (or npm install) puts them under the same node_modules directory.

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 package.json.

Author

Tim De Pauw

License

MIT

Current Tags

  • 0.5.4                                ...           latest (4 months ago)

12 Versions

  • 0.5.4                                ...           4 months ago
  • 0.5.3                                ...           a year ago
  • 0.5.2                                ...           a year ago
  • 0.5.1                                ...           a year ago
  • 0.5.0                                ...           a year ago
  • 0.4.0                                ...           a year ago
  • 0.3.0                                ...           a year ago
  • 0.2.3                                ...           a year ago
  • 0.2.2                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 1
Dependencies (18)
Dev Dependencies (5)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |