Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexlur/rollup-plugin-ignore
Replace a module with an empty object.
https://github.com/alexlur/rollup-plugin-ignore
javascript rollup rollup-plugin
Last synced: 2 months ago
JSON representation
Replace a module with an empty object.
- Host: GitHub
- URL: https://github.com/alexlur/rollup-plugin-ignore
- Owner: alex-kinokon
- License: mit
- Created: 2016-10-11T23:24:12.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-08-26T11:36:53.000Z (over 3 years ago)
- Last Synced: 2024-05-18T20:41:50.930Z (7 months ago)
- Topics: javascript, rollup, rollup-plugin
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 26
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome - ignore - Ignore modules by replacing with empty objects. (Plugins / Modules)
README
# 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:
```javascript
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:
```javascript
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:```javascript
ignore(builtinModules, { commonjsBugFix: true })
```## License
MIT