{"id":22123,"library":"rollup-plugin-match","title":"rollup-plugin-match","description":"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.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/fengxinming/rollup-plugins/tree/master/packages/rollup-plugin-match","tags":["javascript","rollup","rollup-plugin-match","rollup-plugin","match","globby"],"install":[{"cmd":"npm install rollup-plugin-match","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-match","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-match","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"used for glob pattern matching","package":"fast-glob","optional":false}],"imports":[{"note":"CommonJS require returns the plugin function directly, not a named export","wrong":"const { match } = require('rollup-plugin-match');","symbol":"default","correct":"const match = require('rollup-plugin-match');\nmodule.exports = { plugins: [match()] }"},{"note":"ESM default import, same as CJS pattern","wrong":"import { match } from 'rollup-plugin-match';","symbol":"default (ESM)","correct":"import match from 'rollup-plugin-match';"},{"note":"It's a factory function, not a class","wrong":"new match() or match.create()","symbol":"match (as function)","correct":"const match = require('rollup-plugin-match');\nmatch()"}],"quickstart":{"code":"// rollup.config.js\nconst match = require('rollup-plugin-match');\nconst empty = require('rollup-plugin-empty');\n\nmodule.exports = {\n  input: 'src/**/*.js',\n  plugins: [\n    empty({ silent: false, dir: 'dist' }),\n    match() // matches files based on input glob\n  ],\n  output: {\n    dir: 'dist',\n    format: 'es',\n    entryFileNames: '[name].js'\n  }\n};","lang":"javascript","description":"Configure Rollup to use match plugin with empty plugin for generating multiple output chunks."},"warnings":[{"fix":"Ensure match() is after file-generating plugins in the plugins array.","message":"The match plugin must be placed after plugins that generate files (like empty) because it matches files from the input glob, not virtual modules.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Refer to fast-glob documentation for available options.","message":"The plugin uses fast-glob under the hood; options passed to match() are directly forwarded to fast-glob. Not all Rollup input options are supported.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Consider using official Rollup code splitting or manual chunks for complex scenarios.","message":"The plugin does not support Rollup's new 'output.manualChunks' or 'preserveModules' directly; it works with basic input globs.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"npm install rollup-plugin-match --save-dev","cause":"Package not installed or missing from node_modules.","error":"Error: Cannot find module 'rollup-plugin-match'"},{"fix":"Use const match = require('rollup-plugin-match') instead of const { match } = require(...)","cause":"Importing as named export instead of default.","error":"TypeError: match is not a function"},{"fix":"Update Rollup: npm install rollup@latest --save-dev","cause":"Incompatible Rollup version (likely too old).","error":"The plugin 'rollup-plugin-match' is not compatible with your Rollup version. Please update Rollup or the plugin."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}