{"id":22066,"library":"rollup-plugin-ignore","title":"rollup-plugin-ignore","description":"Rollup plugin that excludes specified modules from the output bundle, replacing them with an empty default export. Current stable version is 1.0.10, with infrequent releases. It is a minimal, focused tool for preventing Node.js built-ins like `fs` or `net` from being bundled. Unlike alternatives like `@rollup/plugin-virtual`, it specifically removes the module content rather than providing stub implementations. The plugin includes a `commonjsBugFix` option to work around an issue with `@rollup/plugin-commonjs`. It ships TypeScript type definitions and is designed for use with Rollup's ESM-based plugin system.","status":"active","version":"1.0.10","language":"javascript","source_language":"en","source_url":"https://github.com/proteriax/rollup-plugin-ignore","tags":["javascript","rollup","rollup-plugin","typescript"],"install":[{"cmd":"npm install rollup-plugin-ignore","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-ignore","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-ignore","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The default export is a function; named export `ignore` does not exist.","wrong":"import { ignore } from 'rollup-plugin-ignore'","symbol":"ignore (default)","correct":"import ignore from 'rollup-plugin-ignore'"},{"note":"TypeScript only; for type annotations. Not a runtime value.","symbol":"IgnoreOptions (type)","correct":"import type { IgnoreOptions } from 'rollup-plugin-ignore'"},{"note":"In CommonJS, the module uses `module.exports = ...`, so .default is needed for the default export.","wrong":"const ignore = require('rollup-plugin-ignore')","symbol":"CommonJS require","correct":"const ignore = require('rollup-plugin-ignore').default"}],"quickstart":{"code":"import ignore from 'rollup-plugin-ignore';\n\nexport default {\n  input: 'main.js',\n  output: {\n    dir: 'output',\n    format: 'esm',\n  },\n  plugins: [\n    ignore(['fs', 'net']),\n  ],\n};","lang":"typescript","description":"Rollup configuration that excludes the Node.js built-in modules 'fs' and 'net' from the bundle, replacing them with empty exports."},"warnings":[{"fix":"Ensure you are not relying on any side effects from the ignored module.","message":"The plugin replaces the entire module with an empty object; side effects such as `require('module').createServer()` will silently fail at runtime.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Add `{ commonjsBugFix: true }` as second argument to the `ignore` call.","message":"When used with `@rollup/plugin-commonjs`, the plugin may not properly ignore CommonJS modules. Use the `commonjsBugFix` option: `ignore(modules, { commonjsBugFix: true })`.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Keep updated with upstream changes; consider switching to a more robust solution like `@rollup/plugin-virtual` or `rollup-plugin-polyfill-node`.","message":"The `commonjsBugFix` option is a workaround for an issue in `@rollup/plugin-commonjs`; it may be removed in future versions once the upstream bug is fixed.","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":"Use `import ignore from 'rollup-plugin-ignore'` instead of `import { ignore } from 'rollup-plugin-ignore'`.","cause":"Incorrect import syntax: using named import 'ignore' instead of default import.","error":"Error: 'default' is not exported by node_modules/rollup-plugin-ignore/index.mjs"},{"fix":"Use `const ignore = require('rollup-plugin-ignore').default;`","cause":"In CommonJS, using `require('rollup-plugin-ignore')` returns an object with `.default` property.","error":"TypeError: ignore is not a function"},{"fix":"Ensure the plugin is imported correctly as the default export and called as a function: `ignore(['fs'])` in the plugins array.","cause":"The plugin is not a function; maybe imported incorrectly in Rollup config.","error":"The plugin 'rollup-plugin-ignore' returned an empty object and will be ignored."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}