{"id":22026,"library":"rollup-plugin-filesize","title":"rollup-plugin-filesize","description":"A Rollup plugin that displays the size of output files in the CLI, including minified, gzipped, and Brotli sizes. Version 10.0.0 is the latest stable, requiring Node >=16 and Rollup >=4 (ESM-only). It offers customizable output formatting, a reporter API for custom handlers (e.g., badge generation), and experimental size comparisons against previous releases or builds. Differentiates from alternative size plugins with built-in Brotli support and theme-aware display.","status":"active","version":"10.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/ritz078/rollup-plugin-filesize","tags":["javascript","rollup-plugin","typescript"],"install":[{"cmd":"npm install rollup-plugin-filesize","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-filesize","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-filesize","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; plugin is designed for Rollup","package":"rollup","optional":false}],"imports":[{"note":"Package is ESM-only since v10; CommonJS require will fail.","wrong":"const filesize = require('rollup-plugin-filesize');","symbol":"filesize","correct":"import filesize from 'rollup-plugin-filesize';"},{"note":"Named export available for tree-shaking; both work but named is preferred.","wrong":"import filesize from 'rollup-plugin-filesize';","symbol":"filesize","correct":"import { filesize } from 'rollup-plugin-filesize';"},{"note":"Plugin type is from Rollup, not from this package.","wrong":"import { Plugin } from 'rollup-plugin-filesize';","symbol":"Plugin","correct":"import type { Plugin } from 'rollup';"}],"quickstart":{"code":"import { rollup } from 'rollup';\nimport filesize from 'rollup-plugin-filesize';\n\nasync function build() {\n  const bundle = await rollup({\n    input: 'src/index.js',\n    plugins: [\n      filesize({\n        showMinifiedSize: true,\n        showGzippedSize: true,\n        showBrotliSize: false,\n        theme: 'dark'\n      })\n    ]\n  });\n  await bundle.write({ file: 'dist/bundle.js', format: 'es' });\n}\n\nbuild().catch(err => console.error(err));","lang":"typescript","description":"Shows how to integrate the plugin into a Rollup build, displaying minified and gzipped sizes."},"warnings":[{"fix":"Use import syntax and ensure Node >=16.","message":"Version 10 drops CommonJS support; package is ESM-only.","severity":"breaking","affected_versions":">=10.0.0"},{"fix":"If minification is needed, use a separate plugin like @rollup/plugin-terser.","message":"Version 6 drops terser for minification; minification is optional.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Replace 'render' with 'reporter' option.","message":"The 'render' function option is deprecated; use 'reporter' instead.","severity":"deprecated","affected_versions":">=5.0.0"},{"fix":"Check console output for per-file sizes; aggregate manually if needed.","message":"For code-splitting builds, the plugin reports each file individually.","severity":"gotcha","affected_versions":">=6.1.0"},{"fix":"Use v8.0.1 or later on Windows.","message":"Windows compatibility fixed in v8.0.1 for import paths.","severity":"gotcha","affected_versions":">=8.0.1"},{"fix":"Do not rely on it for production use.","message":"showBeforeSizes is experimental and may change.","severity":"deprecated","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use import syntax instead of require().","cause":"Package is ESM-only; CommonJS require fails.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module not supported"},{"fix":"Use import filesize from 'rollup-plugin-filesize'.","cause":"Default import used but named import does not match.","error":"TypeError: filesize is not a function"},{"fix":"Run npm install rollup-plugin-filesize --save-dev.","cause":"Package not installed or incorrect path.","error":"Error: Cannot find module 'rollup-plugin-filesize'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}