Skip to content

Replace a module with an empty object.

License

Notifications You must be signed in to change notification settings

alex-kinokon/rollup-plugin-ignore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rollup-plugin-ignore

Prevent a module from showing up in the output bundle. You will get export default {} instead.

Installation

npm install --save-dev rollup-plugin-ignore
yarn add rollup-plugin-ignore --dev

Usage

Let’s say you want to prevent fs and net from being bundled:

import ignore from "rollup-plugin-ignore"

export default {
  input: "main.js",
  plugins: [ignore(["fs", "net"])],
}

To ignore all built-in Node.js modules, use the following:

import { builtinModules } from "module"
import ignore from "rollup-plugin-ignore"

export default {
  input: "main.js",
  plugins: [
    ignore(builtinModules),
  ],
}),

Note: If you are having problems with using @rollup/plugin-commonjs with this plugin, try the temporary fix:

ignore(builtinModules, { commonjsBugFix: true })

License

MIT

About

Replace a module with an empty object.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published