PabloRosales JavaScript Developer

Rollup CheatSheet


Basics

Install globally:

Install locally in your project:

Simplest Rollup command for a single file with UMD and output to stdout:

Bundling a single entry file with UMD and specifying output file:

Bundling a single entry file with IIFE (best for script tags in HTML) and specifying output file:

Using a config file:

The simplest config for IIFE:

Running Rollup and watching our files (-w):

Adding watch options to our config file (for UMD):

Installing a plugin for CSS:

Using our CSS Only plugin (if you use watch it will watch for changes in the CSS too):

Multiple bundles from the same config:

Made with by PR