Registry / devops / rollup-plugin-esformatter

rollup-plugin-esformatter

JSON →
library3.1.0jsnpmunverified

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.

npm install rollup-plugin-esformatter
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-ESFO
R
rollup-plugin-esformatter
devopsjavascriptv3.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

esformatter
import esformatter from 'rollup-plugin-esformatter'
const esformatter = require('rollup-plugin-esformatter')
Default export; use default import style. CJS require works but ESM recommended.
default export (plugin function)
const esformatter = require('rollup-plugin-esformatter')
const { esformatter } = require('rollup-plugin-esformatter')
Plugin is a default export, not a named export. Destructuring will yield undefined.
TypeScript types
import esformatter from 'rollup-plugin-esformatter' // See @types/rollup-plugin-esformatter or inline type: (options?: EsFormatterOptions) => Plugin
Package does not ship its own TypeScript declarations; install @types/rollup-plugin-esformatter or define manually.

Basic Rollup configuration using rollup-plugin-esformatter to format the output bundle with two-space indentation.

import esformatter from 'rollup-plugin-esformatter'; export default { input: './src/index.js', output: { file: './dist/bundle.js', format: 'es', }, plugins: [ esformatter({ indent: { value: ' ', }, // additional esformatter options }), ], };
Debug
Known issues
breakingVersion 2.0.0 removed support for Node <10. Version 3.0.0 removed support for Node <14.
fix
Upgrade Node to >=14 for v3.x, >=10 for v2.x.
affects: >=2.0.0
deprecatedThe 'sourceMap' option (camelCase) was deprecated in v0.6.0 and removed in v1.0.0; use 'sourcemap' (lowercase) instead.
fix
Replace 'sourceMap' with 'sourcemap' in plugin options.
affects: >=0.6.0 <1.0.0
gotchaSource maps are disabled by default. To enable, set sourcemap: true in plugin options and ensure sourcemap: true in Rollup output options.
fix
Explicitly set sourcemap: true in both Rollup output config and plugin options.
affects: >=0.4.0
gotchaThe plugin applies esformatter on the whole bundle after all transforms, not per-module. This may affect formatting consistency.
fix
Be aware that final bundle formatting may differ from per-module formatting. Use esformatter with compatible options.
affects: >=0.1.0
deprecatedGreenkeeper badge in README indicates automated dependency updates are handled, but Greenkeeper is deprecated in favor of Renovate or Dependabot.
fix
No action needed; badge is just informational.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'rollup-plugin-esformatter'
Missing or incorrectly installed package.
fix
Run 'npm install --save-dev rollup-plugin-esformatter' or 'yarn add --dev rollup-plugin-esformatter'.
TypeError: esformatter is not a function
Incorrect import: using named import instead of default import.
fix
Use 'import esformatter from 'rollup-plugin-esformatter'' or 'const esformatter = require('rollup-plugin-esformatter')'.
Error: Rollup plugin 'rollup-plugin-esformatter' requires a peer dependency but none was installed.
Missing peer dependency 'rollup'.
fix
Install rollup: 'npm install --save-dev rollup' (ensure version ^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0).
Warning: The 'sourceMap' option is deprecated. Use 'sourcemap' instead.
Using deprecated camelCase option name.
fix
Replace 'sourceMap' with 'sourcemap' in plugin options.
Upgrade
Version history
3.1.0latest on npm
Audit
Dependencies
rolluprequiredpeer dependency required for plugin to function as a Rollup plugin
Agent activity
8 hits · last 30 days
node
6
Resources
rollup-plugin-esformatter — npm install rollup-plugin-esformatter · libregistry