Rollup reference
1 June 2023 (Updated 15 October 2023)
On this page
In a nutshell
Rollup is a module bundler for JavaScript that lets you write modern JS using all the latest features and to output your bundle in formats like AMD, CommonJS, ES modules or an IIFE.
# compile to a <script> containing a self-executing function ('iife')
rollup main.js --file bundle.js --format iife
# compile to a CommonJS module ('cjs')
rollup main.js --file bundle.js --format cjs
# UMD format requires a bundle name
rollup main.js --file bundle.js --format umd --name "myBundle"
The quickest way to understand is to view the example repo.
Output formats
Popular plugins
Tagged:
JavaScript tooling
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment