{"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,"search_vec":"'10.0.0':25 '16':32 '4':35 'altern':64 'api':46 'awar':76 'badg':51 'brot':22,71 'build':61 'built':69 'built-in':68 'cli':17 'comparison':56 'custom':48 'customiz':41 'differenti':62 'display':9,77 'e.g':50 'esm':37 'esm-on':36 'experiment':54 'file':14 'files':4 'format':43 'generat':52 'gzip':20 'handler':49 'includ':18 'javascript':78 'latest':28 'minifi':19 'node':31 'offer':40 'output':13,42 'plugin':3,7,66,81 'previous':58 'releas':59 'report':45 'requir':30 'rollup':2,6,34,80 'rollup-plugin':79 'rollup-plugin-files':1 'size':11,23,55,65 'stabl':29 'support':72 'theme':75 'theme-awar':74 'typescript':82 'version':24","created_at":"2026-04-27T17:03:00.304622+00:00","updated_at":"2026-04-27T17:03:00.304622+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/ritz078/rollup-plugin-filesize","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/rollup-plugin-filesize","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-18","next_check":"2026-07-26","install_tag":null}}