Registry / devops / rollup-plugin-ignore

rollup-plugin-ignore

JSON →
library1.0.10jsnpmunverified

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.

npm install rollup-plugin-ignore
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-IGNO
R
rollup-plugin-ignore
devopsjavascriptv1.0.10
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.

ignore (default)
import ignore from 'rollup-plugin-ignore'
import { ignore } from 'rollup-plugin-ignore'
The default export is a function; named export `ignore` does not exist.
IgnoreOptions (type)
import type { IgnoreOptions } from 'rollup-plugin-ignore'
TypeScript only; for type annotations. Not a runtime value.
CommonJS require
const ignore = require('rollup-plugin-ignore').default
const ignore = require('rollup-plugin-ignore')
In CommonJS, the module uses `module.exports = ...`, so .default is needed for the default export.

Rollup configuration that excludes the Node.js built-in modules 'fs' and 'net' from the bundle, replacing them with empty exports.

import ignore from 'rollup-plugin-ignore'; export default { input: 'main.js', output: { dir: 'output', format: 'esm', }, plugins: [ ignore(['fs', 'net']), ], };
Debug
Known issues
gotchaThe plugin replaces the entire module with an empty object; side effects such as `require('module').createServer()` will silently fail at runtime.
fix
Ensure you are not relying on any side effects from the ignored module.
affects: >=1.0.0
gotchaWhen used with `@rollup/plugin-commonjs`, the plugin may not properly ignore CommonJS modules. Use the `commonjsBugFix` option: `ignore(modules, { commonjsBugFix: true })`.
fix
Add `{ commonjsBugFix: true }` as second argument to the `ignore` call.
affects: >=1.0.0
deprecatedThe `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.
fix
Keep updated with upstream changes; consider switching to a more robust solution like `@rollup/plugin-virtual` or `rollup-plugin-polyfill-node`.
affects: >=1.0.0
Errors
Common errors & fixes
Error: 'default' is not exported by node_modules/rollup-plugin-ignore/index.mjs
Incorrect import syntax: using named import 'ignore' instead of default import.
fix
Use `import ignore from 'rollup-plugin-ignore'` instead of `import { ignore } from 'rollup-plugin-ignore'`.
TypeError: ignore is not a function
In CommonJS, using `require('rollup-plugin-ignore')` returns an object with `.default` property.
fix
Use `const ignore = require('rollup-plugin-ignore').default;`
The plugin 'rollup-plugin-ignore' returned an empty object and will be ignored.
The plugin is not a function; maybe imported incorrectly in Rollup config.
fix
Ensure the plugin is imported correctly as the default export and called as a function: `ignore(['fs'])` in the plugins array.
Upgrade
Version history
1.0.10latest on npm
Audit
Dependencies

No dependency data recorded yet.

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