rollup-plugin-webpack-stats weekly downloads statistics
By relative-ci (5 listings) · npm · Vite plugins
Rollup/Vite/Rolldown plugin to generate a stats JSON file with a bundle-stats webpack-compatible structure
rollup-plugin-webpack-stats has 437,276 recorded weekly downloads on npm, an increase of 8.0% over the past 30 days, ranking #415 of 3,247 tracked listings.
About rollup-plugin-webpack-stats
rollup-plugin-webpack-stats
Rollup/Vite/Rolldown plugin to generate a stats JSON file with a bundle-stats webpack-compatible structure.
[!NOTE] This plugin generates a webpack-compatible stats JSON file for programmatic usage, inspection, or integration with other compatible tools. To analyze your Rollup/Vite/Rolldown bundle, use
rollup-plugin-bundle-statsinstead.
Install
npm install --dev rollup-plugin-webpack-stats
or
yarn add --dev rollup-plugin-webpack-stats
or
pnpm add -D rollup-plugin-webpack-stats
Configure
// rollup.config.js
import webpackStatsPlugin from 'rollup-plugin-webpack-stats';
export default {
plugins: [
// add it as the last plugin
webpackStatsPlugin(),
],
};
// vite.config.js
import { defineConfig } from 'vite';
import webpackStatsPlugin from 'rollup-plugin-webpack-stats';
export default defineConfig((env) => ({
plugins: [
// Output webpack-stats.json file
webpackStatsPlugin(),
],
}));
Options
fileName- the JSON filepath relative to the build folder or absolute(default:webpack-stats.json)transform- access and mutate the resulting stats after the conversion:(stats: WebpackStatsFilterd, sources: TransformSources, bundle: OutputBundle) => WebpackStatsFilterdmoduleOriginalSize- extract module original size or rendered size (default:false)write- format and write the stats to disk(default:fs.write(filename, JSON.stringify(stats, null, 2)))- rollup stats options (rollup-plugin-stats)
excludeAssets- exclude matching assets:string | RegExp | ((filepath: string) => boolean) | Array<string | RegExp | ((filepath: string) => boolean)>excludeModules- exclude matching modules:string | RegExp | ((filepath: string) => boolean) | Array<string | RegExp | ((filepath: string) => boolean)>
Examples
Output to a custom filename
// rollup.config.js
import webpackStatsPlugin from 'rollup-plugin-webpack-stats';
module.exports = {
plugins: [
// add it as the last plugin
webpackStatsPlugin({
filename: 'artifacts/stats.json',
}),
],
};
Exclude .map files
// rollup.config.js
import webpackStatsPlugin from 'rollup-plugin-webpack-stats';
export default {
plugins: [
// add it as the last plugin
webpackStatsPlugin({
excludeAssets: /\.map$/,
}),
],
};
Vite.js - multiple stats files when using plugin-legacy
// for the the modern and legacy outputs
import { defineConfig } from 'vite';
import legacy from '@vitejs/plugin-legacy';
import webpackStatsPlugin from 'rollup-plugin-webpack-stats';
export default defineConfig((env) => ({
build: {
rollupOptions: {
output: {
plugins: [
// Output webpack-stats-modern.json file for the modern build
// Output webpack-stats-legacy.json file for the legacy build
// Stats are an output plugin, as plugin-legacy works by injecting
// an additional output, that duplicates the plugins configured here
webpackStatsPlugin((options) => {
const isLegacy = options.format === 'system';
return {
fileName: `webpack-stats${isLegacy ? '-legacy' : '-modern'}.json`,
};
}),
],
},
},
},
plugins: [
legacy({
/* Your legacy config here */
}),
],
}));
Vite.js - update initial flag for chunks where the inital flag is incorrectly set to false
import { defineConfig } from 'vite';
import webpackStatsPlugin from 'rollup-plugin-webpack-stats';
export default defineConfig((env) => ({
build: {
rollupOptions: {
output: {
plugins: [
webpackStatsPlugin({
transform: (stats) => {
// Find the target chunk entry
const mainChunkIndex = stats.chunks?.findIndex((chunk) =>
chunk.names?.includes('main')
);
// When the tartget chunk is found, set the initial flag to true
if (
typeof mainChunkIndex !== 'undefined' &&
stats?.chunks?.[mainChunkIndex]
) {
stats.chunks[mainChunkIndex] = {
...stats.chunks[mainChunkIndex],
initial: true,
};
}…
Description from the npm listing.
- vite
- rolldown
- rollup
- vite-plugin
- rolldown-plugin
- rollup-plugin
- stats
- bundle-stats
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm Vite plugins plugins
All 20 rollup-plugin-webpack-stats alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/rollup-plugin-webpack-stats. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.