{"id":21927,"library":"rollup-plugin-blacklist","title":"rollup-plugin-blacklist","description":"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.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/dumbmatter/rollup-plugin-blacklist","tags":["javascript","rollup-plugin"],"install":[{"cmd":"npm install rollup-plugin-blacklist","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-blacklist","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-blacklist","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export only; named import not supported.","wrong":"const { blacklist } = require('rollup-plugin-blacklist')","symbol":"blacklist","correct":"import blacklist from 'rollup-plugin-blacklist'"},{"note":"Namespace import produces an object, not a function.","wrong":"import * as blacklist from 'rollup-plugin-blacklist'","symbol":"default (blacklist)","correct":"import blacklist from 'rollup-plugin-blacklist'"},{"note":"CJS default import works via require, not destructuring.","wrong":"const { blacklist } = require('rollup-plugin-blacklist')","symbol":"blacklist (CommonJS)","correct":"const blacklist = require('rollup-plugin-blacklist')"}],"quickstart":{"code":"// rollup.config.js\nimport blacklist from 'rollup-plugin-blacklist';\n\nexport default {\n  input: 'src/index.js',\n  output: [{ file: 'dist/bundle.js', format: 'esm' }],\n  plugins: [\n    blacklist([/worker/]),\n    // Resolver plugins must come after blacklist\n  ]\n};","lang":"javascript","description":"Shows basic usage: import default export and pass array of regex patterns to exclude matching modules.","dependencies":[]},"warnings":[{"fix":"Ensure blacklist() is the first plugin in the plugins array.","message":"Must be placed before other resolution plugins like @rollup/plugin-node-resolve to block modules at the import name level.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Pass regex patterns: blacklist([/pattern/]).","message":"Patterns are regex objects, not strings. Using strings will be silently ignored.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Alternative: use a more comprehensive plugin like @rollup/plugin-inject or manual tree-shaking.","message":"Does not support dynamic imports or code splitting — only static import statements are blocked.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'1.0.1':17 'accident':36 'blacklist':4 'blacklistifi':25 'browserifi':27 'bundl':15,45 'chain':51 'code':42 'e.g':40 'earli':48 'exclud':8 'file':9 'filter':32 'inclus':37 'inspir':23 'javascript':56 'latest':18 'like':54 'main':44 'match':10 'mechan':33 'modul':39 'pattern':12 'plugin':3,6,50,59 'prevent':35 'provid':29 'releas':22 'resolv':53 'rollup':2,5,58 'rollup-plugin':57 'rollup-plugin-blacklist':1 'rollup/plugin-node-resolve':55 'simpl':31 'specifi':11 'typic':46 'use':47 'version':16 'worker':41","created_at":"2026-04-27T17:02:29.738892+00:00","updated_at":"2026-04-27T17:02:29.738892+00:00","problems":[{"fix":"Install with npm install --save-dev rollup-plugin-blacklist and use default import: import blacklist from 'rollup-plugin-blacklist'.","cause":"Package not installed or incorrect import path (e.g., using named import instead of default).","error":"Cannot find module 'rollup-plugin-blacklist'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/dumbmatter/rollup-plugin-blacklist","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/rollup-plugin-blacklist","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-18","next_check":"2026-07-26","install_tag":null}}