Rollup plugin for seamless integration with Istanbul code coverage instrumentation. Current stable version is 5.0.0, released with support for Rollup v4 and Node.js 16+. It instruments source files before bundling, ensuring test code is not covered. Key differentiators: works as a Rollup plugin, supports source maps, configurable instrumenter options, and minimal setup. Published under MIT license, maintained by artberri. Released at a moderate cadence with 5 major versions.
npm install rollup-plugin-istanbul2Verified import paths — ran on the pinned version, not inferred.
Minimal Rollup configuration using rollup-plugin-istanbul to instrument source files, excluding test directory.
Update to >=2.0.0 and use istanbul-lib-instrument compatible options (see instrumenterConfig).
If you relied on old defaults, explicitly set these options to false in instrumenterConfig.
Upgrade Node to >=14 and test coverage output for changes.
Upgrade Node to >=16, Rollup to >=4, and update instrumenterConfig if needed.
Always set 'exclude' option (e.g., exclude: ['test/**/*.js']) to prevent instrumenting test files.
Pass compact via instrumenterConfig: { compact: true }.Use: import istanbul from 'rollup-plugin-istanbul';
Use: const istanbul = require('rollup-plugin-istanbul').default;Run: npm install --save-dev istanbul-lib-instrument