Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report

rollup 4.9.6

Next-generation ES module bundler
Package summary
Share
0
issues
0
licenses
Package created
14 May 2015
Version published
21 Jan 2024
Maintainers
5
Total deps
0
Direct deps
0
License
MIT
Generating a report...
Hold on while we generate a fresh audit report for this package.

Frequently Asked Questions

What does rollup do?

Rollup is a modern JavaScript module bundler that compiles snippets of code into more complex structures such as a library or application. Leveraging the standardized ES module format, it lets you seamlessly merge the most practical individual functions from your preferred libraries. Whether you're working on increasing the speed of native load times in modern browsers or outputting a legacy module format to support ES module workflows, Rollup has your back. It not only facilitates the use of ES modules but also optimizes imported code through static analysis, ensuring only the features that are used are included, a technique known as Tree Shaking. This results in lighter, faster, and less convoluted libraries and applications, letting you write future-proof code in the process.

How do you use rollup?

To implement Rollup in your project, start with installing it by running npm install --global rollup. You can use Rollup through its command-line interface along with an optional configuration file or through its JavaScript API. For instance,

# Run this command to compile to a <script> containing a self-executing function
rollup main.js --format iife --file bundle.js

# Or this one to compile to a CommonJS module for Node.js
rollup main.js --format cjs --file bundle.js

# And this one to compile in UMD format for both browsers and Node.js
rollup main.js --format umd --name "myBundle" --file bundle.js

The commands referenced above imply that your application's entry point is named main.js and you'd like to compile all imports into a single file named bundle.js.

Use the rollup --help command to see the complete list of available options and parameters.

Where are the rollup docs?

The comprehensive documentation for Rollup is conveniently available on the official Rollup website: https://rollupjs.org/. The website provides a quick start guide, a list of available commands, reasons to use Rollup, information about Tree Shaking, compatibility concerns, and how to contribute to the project. Get detailed instructions and examine common configuration options with the starter project templates; rollup-starter-lib and rollup-starter-app. If you're interested in taking a deeper dive into the world of Rollup, peruse through the user guide available at https://rollupjs.org/introduction/.