Registry / devops / rollup-plugin-match

rollup-plugin-match

JSON →
library1.0.0jsnpmunverified

A Rollup plugin that matches input files using glob patterns via fast-glob. Version 1.0.0 is stable with no recent updates. It integrates with Rollup to allow flexible file matching, often used in conjunction with other plugins like rollup-plugin-empty to generate multiple output chunks. Differentiators: simple API, leverages fast-glob performance, and minimal configuration.

npm install rollup-plugin-match
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-MATC
R
rollup-plugin-match
devopsjavascriptv1.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const match = require('rollup-plugin-match'); module.exports = { plugins: [match()] }
const { match } = require('rollup-plugin-match');
CommonJS require returns the plugin function directly, not a named export
default (ESM)
import match from 'rollup-plugin-match';
import { match } from 'rollup-plugin-match';
ESM default import, same as CJS pattern
match (as function)
const match = require('rollup-plugin-match'); match()
new match() or match.create()
It's a factory function, not a class

Configure Rollup to use match plugin with empty plugin for generating multiple output chunks.

// rollup.config.js const match = require('rollup-plugin-match'); const empty = require('rollup-plugin-empty'); module.exports = { input: 'src/**/*.js', plugins: [ empty({ silent: false, dir: 'dist' }), match() // matches files based on input glob ], output: { dir: 'dist', format: 'es', entryFileNames: '[name].js' } };
Debug
Known issues
gotchaThe match plugin must be placed after plugins that generate files (like empty) because it matches files from the input glob, not virtual modules.
fix
Ensure match() is after file-generating plugins in the plugins array.
affects: >=1.0.0
gotchaThe plugin uses fast-glob under the hood; options passed to match() are directly forwarded to fast-glob. Not all Rollup input options are supported.
fix
Refer to fast-glob documentation for available options.
affects: >=1.0.0
deprecatedThe plugin does not support Rollup's new 'output.manualChunks' or 'preserveModules' directly; it works with basic input globs.
fix
Consider using official Rollup code splitting or manual chunks for complex scenarios.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'rollup-plugin-match'
Package not installed or missing from node_modules.
fix
npm install rollup-plugin-match --save-dev
TypeError: match is not a function
Importing as named export instead of default.
fix
Use const match = require('rollup-plugin-match') instead of const { match } = require(...)
The plugin 'rollup-plugin-match' is not compatible with your Rollup version. Please update Rollup or the plugin.
Incompatible Rollup version (likely too old).
fix
Update Rollup: npm install rollup@latest --save-dev
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
fast-globrequiredused for glob pattern matching
Agent activity
4 hits · last 30 days
node
4
Resources
rollup-plugin-match — npm install rollup-plugin-match · libregistry