APIActive

Rollup JavaScript API

Node.js JavaScript API for building Rollup bundles programmatically.

Open source page ↗

Product features

Product features

assert> ​

bundle.close

Lets plugins clean up external processes via the closeBundle hook.

bundle.generate

Generates output in-memory and can be called multiple times per bundle.

bundle.write

Writes generated output directly to disk.

--bundleConfigAsCjs ​

Caveats when using native Node ES modules ​

Command line flags ​

Command Line Interface

Config Intellisense ​

--configImportAttributesKey <with

Configuration Files ​

Differences to the JavaScript API ​

Getting the current directory ​

Importing package.json ​

Loading a configuration from a Node package ​

Accessing the parser

Access Rollup's parser.

Programmatically loading a config file

Load a Rollup config file programmatically.

rollup.rollup

Receives input options and returns a Promise resolving to a bundle object.

rollup.watch

Watch API with watchOptions for rebuilding on changes.