Registry / devops / babel-preset-evergreen

babel-preset-evergreen

JSON →
library0.11.13jsnpmunverified

A Babel preset targeting modern JavaScript (ES2024) with automatic polyfill management via core-js. Current version 0.11.13 requires @babel/core ^7.29.0 and Node >=20.18.0. Unlike other presets like @babel/preset-env, evergreen focuses on evergreen browsers and offers flexible polyfill strategies (global or pure) with mini-program support. Release cadence is irregular; package is part of the best-shot ecosystem.

npm install babel-preset-evergreen
INSTALL
IMPORT
SIG · BABEL-PRESET-EVERG
B
babel-preset-evergreen
devopsjavascriptv0.11.13
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 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

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

preset
{ "presets": ["evergreen"] }
{ "presets": ["babel-preset-evergreen"] }
In babel.config.json, the preset name is 'evergreen', not the full package name. Use 'evergreen' as the string in the presets array.
default
import preset from 'babel-preset-evergreen';
const preset = require('babel-preset-evergreen');
The package is ESM-only since v0.11.0. Use import syntax in JS/TS files if programmatically accessing the preset. For babel.config.json, use the string syntax.
polyfill option
{ "presets": [ ["evergreen", { "polyfill": { "usage": "global" } }] ] }
{ "presets": [ ["evergreen", { "useBuiltIns": "usage" }] ] }
The option is 'polyfill', not 'useBuiltIns'. It supports sub-options 'usage' (global|pure), 'include', 'exclude', and 'mini'. The default is false (no polyfill).

Configures Babel to transpile modern JS and add global polyfills for Chrome 60+.

// Install: npm install babel-preset-evergreen @babel/core --save-dev // babel.config.json { "targets": "chrome >= 60", "presets": [ [ "evergreen", { "polyfill": { "usage": "global" } } ] ] } // This config transforms modern JS and adds global polyfills for targets chrome >= 60.
Debug
Known issues
breakingRequires Node >=20.18.0 and @babel/core ^7.29.0. Older Node or Babel versions will fail.
fix
Update Node to >=20.18.0 and @babel/core to ^7.29.0.
affects: >=0.11.0
breakingESM-only since v0.11.0. CommonJS require() throws ERR_REQUIRE_ESM.
fix
Use import or dynamic import. For babel config, use string preset name 'evergreen', not require().
affects: >=0.11.0
deprecatedcore-js@2 is not supported; peg core-js@3 to avoid polyfill conflicts.
fix
Run: npm install core-js@3 --save-dev or pin in package.json.
affects: >=0.11.0
gotchaWhen using polyfill option, 'usage: global' adds polyfills globally, possibly impacting other code. 'pure' adds per-file imports.
fix
Choose 'global' for CLIs/libraries, 'pure' for applications to avoid global scope pollution.
affects: >=0.11.0
deprecatedThe 'polyfill.mini' option enables miniprogram presets which are rarely used and may be dropped.
fix
Avoid using polyfill.mini unless targeting miniprogram environments.
affects: >=0.11.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/babel-preset-evergreen/index.js from /path/to/project/babel.config.js not supported.
Using require() to load babel-preset-evergreen in babel.config.js (CommonJS) while package is ESM-only.
fix
Rename file to babel.config.mjs or use the string preset name: "presets": ["evergreen"].
Error: [BABEL] unknown preset: "babel-preset-evergreen"
Using the full package name (including 'babel-preset-') in the presets array instead of just 'evergreen'.
fix
Use "evergreen" as the preset name. Babel resolves 'evergreen' to 'babel-preset-evergreen'.
SyntaxError: Unexpected token 'export' (or modern feature not transpiled)
Missing or incorrect Babel configuration; preset not applied.
fix
Ensure babel.config.json exists with correct presets array and that Babel is run on the files.
Upgrade
Version history
0.11.13latest on npm
Audit
Dependencies
@babel/corerequiredpeer dependency; required for Babel transformation
Agent activity
21 hits · last 30 days
node
18
OpenAI (training)
1
Resources
babel-preset-evergreen — npm install babel-preset-evergreen · libregistry