Rollup plugin to ignore imports based on file extensions (e.g., .css, .scss) during bundling, replacing them with a configurable stub. Version 1.3.2 is the latest stable release. The plugin uses rollup-pluginutils for filtering and supports both extension and include patterns. It's useful in test environments or when you want to exclude static assets from the bundle without ejecting. Unlike rollup-plugin-string or inject, this plugin fully removes the import and substitutes a default export.
npm install rollup-plugin-ignore-importVerified import paths — ran on the pinned version, not inferred.
Shows how to configure rollup-plugin-ignore-import to replace .css and .scss imports with a configurable stub, while other plugins like resolve still work.
Install rollup-pluginutils explicitly: npm install rollup-pluginutils --save-dev. Or use rollup-plugin-ignore-import@2.0.0 (if available) that may have dropped this dependency.
Specify a `body` option that matches what your code expects, e.g., `body: 'export default {};'` for CSS modules.Use `extensions: ['.css']` instead of `include: ['**/*.css']`. If you need exclude, consider a different plugin like rollup-plugin-filter.
Run `npm install rollup-pluginutils --save-dev` or add it to devDependencies manually.
Use `import ignoreImport from 'rollup-plugin-ignore-import'` instead of `require`.
Change `import { ignoreImport } from 'rollup-plugin-ignore-import'` to `import ignoreImport from 'rollup-plugin-ignore-import'`.