gitmyhub

plugins

JavaScript ★ 3.8k updated 1mo ago

🍣 The one-stop shop for official Rollup plugins

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.

JavaScriptTypeScriptNode.jspnpmsetup: easycomplexity 2/5

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.

Where it fits