rollup-plugin-fileinfo

raw JSON →
0.3.8 verified Mon Apr 27 auth: no javascript

A Rollup plugin that displays file size information for generated bundles. Version 0.3.8, released sparsely (no recent major changes). Helps developers monitor output sizes during builds. Minimal dependencies, focused solely on reporting file sizes. Alternatives like rollup-plugin-visualizer provide more detailed visualization.

error Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
cause Rollup config uses CommonJS (require) but the plugin is an ES module.
fix
Use dynamic import or configure Rollup with type: 'module' in package.json.
error TypeError: fileinfo is not a function
cause Using default import instead of named import.
fix
Use import { fileinfo } from 'rollup-plugin-fileinfo'.
gotcha Plugin only reports file sizes; it does not modify output or provide any other analysis.
fix For more detailed analysis, consider rollup-plugin-visualizer.
gotcha Named export must be used; default export is not available.
fix Use import { fileinfo } from 'rollup-plugin-fileinfo' instead of default import.
gotcha The plugin requires Node.js version 8 or above, but some users may have older versions.
fix Upgrade Node.js to version 8 or higher.
npm install rollup-plugin-fileinfo
yarn add rollup-plugin-fileinfo
pnpm add rollup-plugin-fileinfo

Shows how to import and use the fileinfo plugin in a Rollup configuration.

import { fileinfo } from 'rollup-plugin-fileinfo';

const config = {
  input: 'src/index.js',
  output: {
    file: 'dist/bundle.js',
    format: 'esm'
  },
  plugins: [
    fileinfo({
      // optional: customize output or logging
    })
  ]
};

export default config;