{"id":22223,"library":"rollup-plugin-size","title":"rollup-plugin-size","description":"Prints gzipped sizes of Rollup bundle assets and tracks changes since last build. Version 0.3.1 is the latest release, with low maintenance. It is a port of Google Chrome Labs' size-plugin for Webpack, providing per-file size comparison and historical tracking via a stored .size-snapshot.json file. Key differentiator: integrates directly into Rollup's output lifecycle.","status":"maintenance","version":"0.3.1","language":"javascript","source_language":"en","source_url":"https://github.com/luwes/rollup-plugin-size","tags":["javascript"],"install":[{"cmd":"npm install rollup-plugin-size","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-size","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-size","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency (peerDep in package.json)","package":"rollup","optional":false}],"imports":[{"note":"Default export is a function. Named export does not exist.","wrong":"const { size } = require('rollup-plugin-size')","symbol":"size","correct":"import size from 'rollup-plugin-size'"},{"note":"The package does not export TypeScript types. Use Rollup's Plugin type for annotation.","wrong":"import { Plugin } from 'rollup-plugin-size'","symbol":"Plugin (type)","correct":"import type { Plugin } from 'rollup'; import size from 'rollup-plugin-size'"}],"quickstart":{"code":"import size from 'rollup-plugin-size';\n\nexport default {\n  input: 'src/main.js',\n  output: { dir: 'dist', format: 'esm' },\n  plugins: [size()]\n};","lang":"javascript","description":"Basic Rollup configuration using rollup-plugin-size to print gzipped sizes of output files."},"warnings":[{"fix":"Set the 'filename' option to a custom path or add .size-snapshot.json to .gitignore.","message":"The plugin writes a .size-snapshot.json file in the current directory by default, which may conflict with version control or CI processes.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Remove the 'profile' option from plugin configuration.","message":"The 'profile' option has been removed in recent versions.","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"Install Rollup via `npm install --save-dev rollup`.","message":"The plugin requires the 'rollup' peer dependency to be installed. It will not work without Rollup being present in the project.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Commit the .size-snapshot.json file to version control if you want persistent change tracking across builds.","message":"Changes tracking is based on a file system snapshot; if the snapshot is deleted or not committed across environments, comparisons will be incomplete.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use `import size from 'rollup-plugin-size'` (default import).","cause":"Using a named import `{ size }` instead of default import.","error":"TypeError: size is not a function"},{"fix":"Run `npm install --save-dev rollup-plugin-size`.","cause":"Package not installed or missing from node_modules.","error":"Error: Cannot find module 'rollup-plugin-size'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}