{"id":22010,"library":"rollup-plugin-esformatter","title":"rollup-plugin-esformatter","description":"A Rollup plugin that runs esformatter on the final bundle, providing JavaScript code formatting/beautification. Current stable version is 3.1.0, supporting Rollup ^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0. It requires Node >=14. Drops support for older Rollup versions and Node <14 as of v3.0.0. Generates source maps by computing diff between original and formatted bundle, but source maps are disabled by default due to performance cost. Useful for consistent code style in build output, alternative to rollup-plugin-prettier. Maintenance mode, with infrequent updates.","status":"active","version":"3.1.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/mjeanroy/rollup-plugin-esformatter","tags":["javascript","rollup","rollup-plugin","esformatter"],"install":[{"cmd":"npm install rollup-plugin-esformatter","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-esformatter","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-esformatter","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for plugin to function as a Rollup plugin","package":"rollup","optional":false}],"imports":[{"note":"Default export; use default import style. CJS require works but ESM recommended.","wrong":"const esformatter = require('rollup-plugin-esformatter')","symbol":"esformatter","correct":"import esformatter from 'rollup-plugin-esformatter'"},{"note":"Plugin is a default export, not a named export. Destructuring will yield undefined.","wrong":"const { esformatter } = require('rollup-plugin-esformatter')","symbol":"default export (plugin function)","correct":"const esformatter = require('rollup-plugin-esformatter')"},{"note":"Package does not ship its own TypeScript declarations; install @types/rollup-plugin-esformatter or define manually.","wrong":"","symbol":"TypeScript types","correct":"import esformatter from 'rollup-plugin-esformatter'\n// See @types/rollup-plugin-esformatter or inline type: (options?: EsFormatterOptions) => Plugin"}],"quickstart":{"code":"import esformatter from 'rollup-plugin-esformatter';\n\nexport default {\n  input: './src/index.js',\n  output: {\n    file: './dist/bundle.js',\n    format: 'es',\n  },\n  plugins: [\n    esformatter({\n      indent: {\n        value: '  ',\n      },\n      // additional esformatter options\n    }),\n  ],\n};","lang":"javascript","description":"Basic Rollup configuration using rollup-plugin-esformatter to format the output bundle with two-space indentation."},"warnings":[{"fix":"Upgrade Node to >=14 for v3.x, >=10 for v2.x.","message":"Version 2.0.0 removed support for Node <10. Version 3.0.0 removed support for Node <14.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Replace 'sourceMap' with 'sourcemap' in plugin options.","message":"The 'sourceMap' option (camelCase) was deprecated in v0.6.0 and removed in v1.0.0; use 'sourcemap' (lowercase) instead.","severity":"deprecated","affected_versions":">=0.6.0 <1.0.0"},{"fix":"Explicitly set sourcemap: true in both Rollup output config and plugin options.","message":"Source maps are disabled by default. To enable, set sourcemap: true in plugin options and ensure sourcemap: true in Rollup output options.","severity":"gotcha","affected_versions":">=0.4.0"},{"fix":"Be aware that final bundle formatting may differ from per-module formatting. Use esformatter with compatible options.","message":"The plugin applies esformatter on the whole bundle after all transforms, not per-module. This may affect formatting consistency.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"No action needed; badge is just informational.","message":"Greenkeeper badge in README indicates automated dependency updates are handled, but Greenkeeper is deprecated in favor of Renovate or Dependabot.","severity":"deprecated","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":"Run 'npm install --save-dev rollup-plugin-esformatter' or 'yarn add --dev rollup-plugin-esformatter'.","cause":"Missing or incorrectly installed package.","error":"Error: Cannot find module 'rollup-plugin-esformatter'"},{"fix":"Use 'import esformatter from 'rollup-plugin-esformatter'' or 'const esformatter = require('rollup-plugin-esformatter')'.","cause":"Incorrect import: using named import instead of default import.","error":"TypeError: esformatter is not a function"},{"fix":"Install rollup: 'npm install --save-dev rollup' (ensure version ^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0).","cause":"Missing peer dependency 'rollup'.","error":"Error: Rollup plugin 'rollup-plugin-esformatter' requires a peer dependency but none was installed."},{"fix":"Replace 'sourceMap' with 'sourcemap' in plugin options.","cause":"Using deprecated camelCase option name.","error":"Warning: The 'sourceMap' option is deprecated. Use 'sourcemap' instead.","affected_versions":">=0.6.0 <1.0.0"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}