Registry / devops / rollup-plugin-es3

rollup-plugin-es3

JSON →
library1.1.0jsnpmunverified

Rollup plugin that removes ES3-incompatible constructs (Object.defineProperty and Object.freeze) from the bundled output. Version 1.1.0 is the latest stable release. It is a lightweight, focused alternative to large transpilers, specifically addressing rollup's __esModule marker and frozen objects for legacy environments.

npm install rollup-plugin-es3
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-ES3
R
rollup-plugin-es3
devopsjavascriptv1.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.

default
import es3 from 'rollup-plugin-es3'
Default export is a function returning a plugin object.
named
import { rollupPluginES3 } from 'rollup-plugin-es3'
const { rollupPluginES3 } = require('rollup-plugin-es3')
Named export available for those who prefer explicit imports.
type
import type { RollupPluginES3Options } from 'rollup-plugin-es3'
TypeScript users can import the options type.

Shows basic usage of the plugin: install, import, and add to rollup plugins array.

import { rollup } from 'rollup'; import es3 from 'rollup-plugin-es3'; const bundle = await rollup({ input: 'src/index.js', plugins: [es3()], }); await bundle.write({ file: 'dist/bundle.js', format: 'iife' });
Debug
Known issues
gotchaPlugin only removes Object.defineProperty and Object.freeze; it does not handle other ES3 incompatibilities like reserved words or trailing commas.
fix
Use additional plugins (e.g., rollup-plugin-es5) for broader ES3 compatibility.
affects: all
breakingv1.0.2 removed support for Object.freeze removal by default (breaking change if relied on).
fix
Update to v1.0.2+; pass { remove: ['freeze'] } to re-enable.
affects: <1.0.2
deprecatedObject.freeze removal is disabled by default since v1.0.2 and may be removed entirely.
fix
Use explicit option { remove: ['freeze'] } if needed.
affects: >=1.0.2
Errors
Common errors & fixes
Error: "Object.defineProperty is not defined"
Plugin not applied or configured incorrectly.
fix
Ensure plugin is installed and added to rollup plugins array: plugins: [es3()]
TypeError: es3 is not a function
Default import used with require instead of import.
fix
Use import es3 from 'rollup-plugin-es3' or const es3 = require('rollup-plugin-es3').default
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
Resources
rollup-plugin-es3 — npm install rollup-plugin-es3 · libregistry