Registry / devops / rollup-plugin-blacklist

rollup-plugin-blacklist

JSON →
library1.0.1jsnpmunverified

Rollup plugin that excludes files matching specified patterns from being bundled. Version 1.0.1 (latest) has no further releases. Inspired by blacklistify for Browserify, it provides a simple filtering mechanism to prevent accidental inclusion of modules (e.g., worker code in main bundle). Typically used early in plugin chain before resolvers like @rollup/plugin-node-resolve.

npm install rollup-plugin-blacklist
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-BLAC
R
rollup-plugin-blacklist
devopsjavascriptv1.0.1
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.

blacklist
import blacklist from 'rollup-plugin-blacklist'
const { blacklist } = require('rollup-plugin-blacklist')
Default export only; named import not supported.
default (blacklist)
import blacklist from 'rollup-plugin-blacklist'
import * as blacklist from 'rollup-plugin-blacklist'
Namespace import produces an object, not a function.
blacklist (CommonJS)
const blacklist = require('rollup-plugin-blacklist')
const { blacklist } = require('rollup-plugin-blacklist')
CJS default import works via require, not destructuring.

Shows basic usage: import default export and pass array of regex patterns to exclude matching modules.

// rollup.config.js import blacklist from 'rollup-plugin-blacklist'; export default { input: 'src/index.js', output: [{ file: 'dist/bundle.js', format: 'esm' }], plugins: [ blacklist([/worker/]), // Resolver plugins must come after blacklist ] };
Debug
Known issues
gotchaMust be placed before other resolution plugins like @rollup/plugin-node-resolve to block modules at the import name level.
fix
Ensure blacklist() is the first plugin in the plugins array.
affects: >=0.0.0
gotchaPatterns are regex objects, not strings. Using strings will be silently ignored.
fix
Pass regex patterns: blacklist([/pattern/]).
affects: >=0.0.0
gotchaDoes not support dynamic imports or code splitting — only static import statements are blocked.
fix
Alternative: use a more comprehensive plugin like @rollup/plugin-inject or manual tree-shaking.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'rollup-plugin-blacklist'
Package not installed or incorrect import path (e.g., using named import instead of default).
fix
Install with npm install --save-dev rollup-plugin-blacklist and use default import: import blacklist from 'rollup-plugin-blacklist'.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
Resources
rollup-plugin-blacklist — npm install rollup-plugin-blacklist · libregistry