A Rollup/Vite/Rolldown plugin (v3.1.1, released April 2026) that generates a stats JSON file with a webpack-compatible structure, enabling use of webpack ecosystem tools like bundle-stats and analyze tools with non-webpack builds. It supports Rollup 3/4, Vite 5-8, and Rolldown 1.0 beta, ships TypeScript types, and offers options like custom filename, asset/module filtering, and transform callback. Unlike direct webpack stats generation, it converts Rollup's output format to the webpack stats schema, making it a bridge tool.
npm install rollup-plugin-webpack-statsVerified import paths — ran on the pinned version, not inferred.
Shows basic setup for Rollup and Vite config files. Plugin must be the last in the plugins array to capture final bundle stats.
Use ESM import syntax: import webpackStatsPlugin from 'rollup-plugin-webpack-stats'
Upgrade to Node 18 or later
Place webpackStatsPlugin() at the end of the plugins array
npm install rollup-plugin-webpack-stats@latest
Install rolldown separately: npm install rolldown@^1.0.0-beta.0
Change to import syntax: import webpackStatsPlugin from 'rollup-plugin-webpack-stats'
Use default import: import webpackStatsPlugin from 'rollup-plugin-webpack-stats'
Use default import: import webpackStatsPlugin from 'rollup-plugin-webpack-stats'
No dependency data recorded yet.