{"id":25298,"library":"esbuild-metadata-report","title":"esbuild Metadata Report","description":"A tool to generate an HTML report from esbuild's metafile output, visualizing bundle metadata such as file sizes, dependencies, and timings. Version 1.0.3, stable. Designed for esbuild, it works as a plugin or standalone function. Differentiable by its interactive, self-contained HTML report that aids debugging and optimization of esbuild builds. Supports CommonJS only.","status":"active","version":"1.0.3","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install esbuild-metadata-report","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-metadata-report","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-metadata-report","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; the report is built from esbuild's metafile output","package":"esbuild","optional":true}],"imports":[{"note":"This package is CJS-only; ES import will fail.","wrong":"import metadataReport from 'esbuild-metadata-report'","symbol":"metadataReport","correct":"const metadataReport = require('esbuild-metadata-report')"},{"note":"Default export is the function/plugin factory.","symbol":"metadataReport","correct":"const metadataReport = require('esbuild-metadata-report')"},{"note":"Named export not available; the package exports a single default function.","wrong":"import { metadataReport } from 'esbuild-metadata-report'","symbol":"metadataReport","correct":"const metadataReport = require('esbuild-metadata-report')"}],"quickstart":{"code":"const esbuild = require('esbuild');\nconst metadataReport = require('esbuild-metadata-report');\n\nesbuild.build({\n  entryPoints: ['app.js'],\n  bundle: true,\n  outfile: 'out.js',\n  metafile: true,\n  plugins: [\n    metadataReport({\n      name: 'My Report',\n      outputFile: 'report.html'\n    })\n  ]\n}).catch(() => process.exit(1));","lang":"javascript","description":"Demonstrates using esbuild-metadata-report as an esbuild plugin to generate an HTML report from the build metafile."},"warnings":[{"fix":"Install @types/esbuild-metadata-report if available, or create custom declarations.","message":"Package does not provide TypeScript types despite having 'Ships TypeScript types: yes' in metadata. Actual types are missing.","severity":"gotcha","affected_versions":"*"},{"fix":"Ensure metafile: true is set in esbuild.build options.","message":"The plugin requires metafile: true in esbuild options; otherwise, the report will be empty or error.","severity":"gotcha","affected_versions":"*"},{"fix":"Use dynamic import() in ESM projects if needed, but prefer require for now.","message":"Version 1.0.3 uses require; no ESM support. Future versions may drop CJS.","severity":"deprecated","affected_versions":"1.0.x"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install esbuild-metadata-report","cause":"Package not installed or missing from node_modules.","error":"Error: Cannot find module 'esbuild-metadata-report'"},{"fix":"Use const metadataReport = require('esbuild-metadata-report')","cause":"Using ES import syntax (import) when package is CJS-only.","error":"TypeError: metadataReport is not a function"},{"fix":"Pass metafile: result.metafile in options object.","cause":"Using function form without passing metafile property.","error":"Error: metafile is required if using as a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}