rollup-plugin-stats
TypeScript icon, indicating that this package has built-in type declarations

1.3.8 • Public • Published

rollup-plugin-stats

Socket Badge ci

Output Rollup stats JSON file

Install

npm install --dev rollup-plugin-stats

or

yarn add --dev rollup-plugin-stats

Configure

Rollup

// rollup.config.mjs
import { defineConfig } from 'rollup';
import stats from 'rollup-plugin-stats';

export default defineConfig({
  // your rollup config
  plugins: [
    // add it as the last plugin
    stats(),
  ],
});
// rollup.config.js
const { defineConfig } = require('rollup');
const stats = require('rollup-plugin-stats');

module.exports = defineConfig({
  // your rollup config
  plugins: [
    // add it as the last plugin
    stats(),
  ],
});

Rolldown

// rolldown.config.js
import { defineConfig } from 'rolldown';
import stats from 'rollup-plugin-stats';

export default defineConfig({
  // your rolldown config
  plugins: [
    // add it as the last plugin
    stats(),
],
});

Options

  • fileName - the JSON filepath relative to the build folder or absolute(default: stats.json)
  • write - format and write the stats to disk(default: fs.write(filename, JSON.stringify(stats, null, 2)))
  • stats
    • source - output asset/chunk/module source (default false)
    • 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)>

Related projects

Generate rollup stats JSON file with a bundle-stats webpack supported structure.

Analyze webpack stats(bundle size, assets, modules, packages) and compare the results between different builds. Support for webpack, rspack, vite, rollup.

Optimize your web app's performance with automated bundle stats analysis and monitoring.

  • 🔮 In-depth bundle stats analysis for every build
  • 📈 Monitor bundle stats changes and identify opportunities for optimizations
  • 🔔 Rule based automated review flow, or get notified via GitHub Pull Request comments, GitHub check reports and Slack messages
  • 🔧 Support for webpack and beta support for Vite/Rollup
  • 🔨 Support for all major CI services(CircleCI, GitHub Actions, Gitlab CI, Jenkins, Travis CI)
  • 🔩 Support for npm, yarn and pnpm; support for monorepos
  • 💕 Always free for Open Source

Readme

Keywords

Package Sidebar

Install

npm i rollup-plugin-stats

Weekly Downloads

21,356

Version

1.3.8

License

MIT

Unpacked Size

29.9 kB

Total Files

18

Last publish

Collaborators

  • vio
  • relativeci-bot