explaingit

rollup/plugins

3,755JavaScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

The official Rollup plugins monorepo, a collection of plugins that add TypeScript, CommonJS, JSON, image, and other file-type support to the Rollup JavaScript bundler, maintained by the Rollup team.

Mindmap

mindmap
  root((rollup plugins))
    What it does
      Official plugin collection
      Extends Rollup bundler
      Monorepo of packages
    Key Plugins
      node-resolve
      commonjs
      typescript babel
      terser minifier
    File Type Support
      JSON YAML CSV
      WebAssembly
      GraphQL
      Images
    Dev Setup
      pnpm workspace
      Published to npm
      Auto changelog
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add TypeScript and JSX compilation to a Rollup build using the official babel or TypeScript plugin

USE CASE 2

Bundle a library that depends on CommonJS packages from npm using the commonjs and node-resolve plugins together

USE CASE 3

Import JSON, YAML, CSV, or WebAssembly files directly in your JavaScript source code by adding the matching plugin

USE CASE 4

Minify and optimize a Rollup bundle for production using the terser plugin without switching to a different bundler

Tech stack

JavaScriptTypeScriptNode.jspnpm

Getting it running

Difficulty · easy Time to first run · 5min
License terms are not described in the README.

In plain English

This repository is the official home for plugins that extend Rollup, a tool used by JavaScript developers to bundle code files together into a single output file for use in browsers or Node.js. Rollup on its own handles basic JavaScript, but plugins are needed to support other file types, compatibility shims, and additional processing steps. This monorepo collects the plugins that the Rollup team considers most important and maintains them together in one place. The collection covers a wide range of tasks. Some plugins add support for importing non-JavaScript file types directly into code: JSON files, CSV and TSV data files, YAML config files, images, GraphQL query files, and WebAssembly binaries. Others handle language compilation, turning TypeScript, JSX, or older JavaScript syntax into formats that browsers can run. There are plugins for code optimization, such as minifying output with Terser or stripping out console.log and debugger statements. A few handle module system differences, like converting the CommonJS format (used in older Node.js packages) to modern ES module syntax. A couple of plugins are particularly common in everyday use. The node-resolve plugin finds and bundles third-party packages from the node_modules folder, which Rollup does not do automatically. The commonjs plugin converts packages that use the older require() module format so they can be included in a Rollup bundle. The repository is organized as a monorepo, meaning all the individual plugins live in a single codebase under the /packages directory but are published separately to the npm package registry. Development uses pnpm for dependency management. There is a publishing script that handles version bumping, changelog generation, and tagging releases on GitHub automatically. The plugins are maintained and officially supported by the Rollup project. A shared pluginutils package provides helper functions used across multiple plugins.

Copy-paste prompts

Prompt 1
Help me set up a Rollup config with the node-resolve and commonjs plugins so I can bundle a Node.js library that imports from node_modules.
Prompt 2
Show me a Rollup config that compiles TypeScript files using the official @rollup/plugin-typescript and outputs both ESM and CJS formats.
Prompt 3
I want to import JSON config files directly in my JavaScript using Rollup, show me how to add @rollup/plugin-json to my rollup.config.js.
Prompt 4
Help me use @rollup/plugin-terser to minify my Rollup bundle output and strip console.log statements using @rollup/plugin-strip.
Open on GitHub → Explain another repo

← rollup on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.