CLIActive

Rollup

JavaScript module bundler used from the command line with optional configuration files.

Open source page ↗

Field note

What it does

Rollup is typically used from the command line, with an optional config file to simplify usage and enable advanced functionality.

Capabilities

Available capabilities

Tags

Tags

Ways to use it

Ways to use it

npm

JavaScript / rollup

cli

JavaScript / Not filed

npm

javascript / rollup

npm

javascript / @rollup/browser

npm

javascript / @rollup/wasm-node

cli

javascript / Not filed

npm

javascript / @rollup/plugin-commonjs

npm

javascript / rollup

cli

javascript / https://rollupjs.org/command-line-interface

cli

javascript / https://rollupjs.org/command-line-interface

npm

javascript / @rollup/plugin-commonjs

npm

javascript / @rollup/plugin-node-resolve

npm

javascript / @rollup/plugin-json

npm

Not filed / rollup

Product features

Product features

assert> ​

--bundleConfigAsCjs

Bundles the configuration file as CommonJS.

--bundleConfigAsCjs ​

Caveats when using native Node ES modules ​

Command line flags

Flags such as --config, --plugin, --environment, --watch, and --silent.

Command line flags

Flags such as --config, --environment, --plugin, --silent, --watch.

Command Line Interface

Configuration Files

Optional ES module config file exporting a default options object.

Config IntelliSense

TypeScript type definitions and defineConfig helper for IDE IntelliSense.

--configPlugin <plugin>

Transpiles the config file to CommonJS using a Rollup plugin, e.g. for TypeScript configs.

--configImportAttributesKey <with

Configuration Files ​

Differences to the JavaScript API ​

--environment <values>

Passes environment values on the command line.

--failAfterWarnings

Exits with a failure code after warnings occur.

--filterLogs <filter>

Filters log messages by the given filter.

--forceExit

Forces Rollup to exit after finishing.

Getting the current directory ​

Importing package.json ​

Loading a configuration from a Node package ​

Multiple configs

Export an array or Promise to build multiple bundles.

-p <plugin>, --plugin <plugin>

Loads and applies the named plugin.

Reading a file from stdin

Supports reading input from stdin via --stdin=ext or --no-stdin.

TypeScript config

Write config files in TypeScript using the --configPlugin option.

-w / --watch

Rebuilds bundles when source files change.