fancy-rollup

raw JSON →
0.5.5 verified Mon Apr 27 auth: no javascript maintenance

fancy-rollup is a multi-process wrapper for Rollup that runs multiple Rollup builds concurrently across CPU cores to speed up bundling. Version 0.5.5 (latest stable) targets Node >=8 and is published on npm. It reads an array of Rollup configurations from rollup.config.js and spawns separate Node processes for each build, providing several reporter styles (interactive, list, silent, etc.) for progress visualization. Unlike Rollup's sequential multi-bundle support, fancy-rollup parallelizes builds out of the box with options for concurrency limits and target selection. The package is in early development (minor version 0.x), with API support still planned. It has no runtime peer dependencies but relies on a compatible rollup installation.

error Error: Cannot find module 'rollup'
cause fancy-rollup cannot locate the rollup package. It searches up the directory tree but fails if no compatible rollup is installed.
fix
Install rollup as a dev dependency: npm install --save-dev rollup
error TypeError: Config must be an array
cause fancy-rollup expects rollup.config.js to export an array of configuration objects, but a single object was exported.
fix
Change module.exports = { ... } to module.exports = [{ ... }]
error Error: Failed to spawn child process
cause Possible permission issues, missing Node.js executable, or system limitation (e.g., max processes reached).
fix
Check that Node.js is installed and the user has permission to spawn processes. Reduce concurrency with -p flag.
deprecated fancy-rollup has not seen updates since 2018. Rolling updates and bug fixes are unlikely.
fix Consider using Rollup's built-in parallelization via --watch or other build tools like esbuild or webpack.
gotcha Rollup configuration must be an array; a single object will be treated as an array of one element? Actually fancy-rollup expects array, but Rollup itself accepts both. If you export a single object, fancy-rollup will likely fail or behave unexpectedly.
fix Always export an array of configuration objects: module.exports = [config1, config2];
gotcha The package uses child_process.fork and Node's module resolution to find rollup. If you have multiple versions of rollup in node_modules, it may pick the wrong one.
fix Ensure only one compatible version (e.g., rollup@^2) is installed in the project's node_modules.
gotcha Concurrency default is number of CPU cores. On machines with limited resources, this may cause memory exhaustion or slowdowns.
fix Use -p option to limit concurrency: fancy-rollup -p 2
gotcha Reporter options: 'interactive' requires TTY; in non-TTY environments it falls back to 'dumb' but this may not be obvious.
fix Explicitly set reporter with -r option if you need non-interactive output in CI.
npm install fancy-rollup
yarn add fancy-rollup
pnpm add fancy-rollup

Installation, configuration with an array of Rollup configs, and CLI usage. Shows concurrency and reporter options.

// Install fancy-rollup as dev dependency
// npm install --save-dev fancy-rollup rollup@^2

// Create rollup.config.js:
module.exports = [
  {
    input: 'src/index.js',
    output: { file: 'dist/index.cjs.js', format: 'cjs' }
  },
  {
    input: 'src/index.js',
    output: { file: 'dist/index.esm.js', format: 'esm' }
  }
];

// Run fancy-rollup:
// npx fancy-rollup
// or add to package.json scripts: "build": "fancy-rollup"

// Advance usage with options:
// npx fancy-rollup -c rollup.config.js -t esm -r interactive -p 2