Skip to content

Command Line Interface

Rich Harris edited this page Aug 19, 2015 · 24 revisions

The command line interface allows you to do most of the things you'd do with the JavaScript API.

First, install rollup as a global module:

npm install -g rollup

(Alternatively, if you're using the rollup command in the context of an npm run script, you can install it as a devDependency for each project, using npm i -D rollup.)

Run rollup -h or rollup --help to view usage instructions.

Usage

rollup [options] <entry file>
  • -v, --version – show version number
  • -i, --input – input (alternative to )
  • -o, --output – output (if absent, prints to stdout. See note 1)
  • -f, --format – the output format (see format)
  • -e, --external – comma-separated list of module IDs to exclude (see external)
  • -g, --globals – comma-separated list of id:name pairs (see globals)
  • -n, --name – name of bundle in UMD/IIFE output (see moduleName)
  • -u, --id – ID for AMD module (default is anonymous) (see moduleId)
  • -m, --sourcemap – generate sourcemap (-m inline for inline map)
  • --no-strict – disable 'use strict' in generated code