A Rollup plugin that provides seamless integration with Istanbul for code coverage. Version 5.0.0 supports Rollup v4 and uses istanbul-lib-instrument v6.0.1. Dropped Node.js 14 support in v5.0.0. Key differentiator: instruments source files before bundling to avoid instrumenting test code, with source map support. Released occasionally, maintained actively.
npm install rollup-plugin-istanbulVerified import paths — ran on the pinned version, not inferred.
Shows how to use rollup-plugin-istanbul with Rollup to instrument source files for code coverage, excluding test files.
Upgrade Node.js to >=16 and review istanbul-lib-instrument migration.
Use Node.js >=14 or stay on v3.x.
Explicitly set old defaults if needed; ensure Rollup >=1.20.0.
Update instrumenterConfig options per istanbul-lib-instrument docs.
Always set exclude or include patterns to avoid instrumenting tests.
Set output.sourcemap: true or 'inline' in Rollup config.
Run npm install --save-dev rollup-plugin-istanbul
Use import istanbul from 'rollup-plugin-istanbul' (default import).
Upgrade Rollup to ^1.20.0||^2.0.0||^3.0.0||^4.0.0.
Set instrumenterConfig.produceSourceMap: true and output.sourcemap: 'inline' or true.