
Company News
Meet the Socket Team at RSAC and BSidesSF 2026
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.
@rolldown/pluginutils
Advanced tools
A utility library for building flexible, composable filter expressions that can be used in plugin hook filters of Rolldown/Vite/Rollup/Unplugin plugins.
A utility library for building flexible, composable filter expressions that can be used in plugin hook filters of Rolldown/Vite/Rollup/Unplugin plugins.
pnpm add @rolldown/pluginutils
import {
exactRegex,
makeIdFiltersToMatchWithQuery,
prefixRegex,
} from '@rolldown/pluginutils';
// Match exactly 'foo.js'
const filter = exactRegex('foo.js');
// Match any id starting with 'lib/'
const prefix = prefixRegex('lib/');
// Match ids with query params (e.g. 'foo.js?bar')
const idFilters = makeIdFiltersToMatchWithQuery(['**/*.js', /\.ts$/]);
// Usage in a plugin to define a hook filter
const myPlugin = {
resolveId: {
filter: {
id: [exactRegex('MY_ID_TO_CHECK'), /some-other-regex/],
},
handler(id) {
// Your code here
},
},
};
[!WARNING] Composable filters are not yet supported in Vite, Rolldown-Vite or unplugin. They can be used in Rolldown plugins only.
import { and, id, include, moduleType, query } from '@rolldown/pluginutils';
// Build a filter expression
const filterExpr = and(
id(/\.ts$/),
moduleType('ts'),
query('foo', true),
);
// Usage in a plugin to define a hook filter
const myPlugin = {
transform: {
filter: [include(filterExpr)],
handler(code, id, options) {
// Your code here
},
},
};
exactRegex(str: string, flags?: string): RegExp — Matches the exact string.prefixRegex(str: string, flags?: string): RegExp — Matches values with the given prefix.makeIdFiltersToMatchWithQuery(input: string | RegExp | (string | RegExp)[]): string | RegExp | (string | RegExp)[] — Adapts filters to match ids with query params.and(...exprs) / or(...exprs) / not(expr) — Logical composition of filter expressions.id(pattern, params?) — Filter by id (string or RegExp).moduleType(type) — Filter by module type (e.g. 'js', 'tsx', or 'json').code(pattern) — Filter by code content.query(key, pattern) — Filter by query parameter.include(expr) / exclude(expr) — Top-level include/exclude wrappers.queries(obj) — Compose multiple query filters.FAQs
A utility library for building flexible, composable filter expressions that can be used in plugin hook filters of Rolldown/Vite/Rollup/Unplugin plugins.
The npm package @rolldown/pluginutils receives a total of 30,121,566 weekly downloads. As such, @rolldown/pluginutils popularity was classified as popular.
We found that @rolldown/pluginutils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.

Research
/Security News
Malicious Packagist packages disguised as Laravel utilities install an encrypted PHP RAT via Composer dependencies, enabling remote access and C2 callbacks.

Research
/Security News
OpenVSX releases of Aqua Trivy 1.8.12 and 1.8.13 contained injected natural-language prompts that abuse local AI coding agents for system inspection and potential data exfiltration.