Registry / web-framework / babel-preset-es2040

babel-preset-es2040

JSON →
library1.1.1jsnpmunverified

A Babel preset that enables a very small subset of ES6 features deemed essential by its authors, deliberately omitting most ES2015+ syntax. Version 1.1.1 is the latest and final release. It is an experimental, opinionated alternative to larger presets like babel-preset-env. Note: the name 'es2040' is ironic, indicating a minimal, possibly frivolous approach. The package is not actively maintained and is not recommended for new projects.

npm install babel-preset-es2040
INSTALL
IMPORT
SIG · BABEL-PRESET-ES204
B
babel-preset-es2040
web-frameworkjavascriptv1.1.1
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.

default export
module.exports = require('babel-preset-es2040')
import preset from 'babel-preset-es2040'
This preset is a CommonJS module. ESM import will fail unless using a bundler that handles CJS interop.
.babelrc config
{"presets": ["es2040"]}
{"presets": ["babel-preset-es2040"]}
Babel resolves the preset name 'es2040' to the package 'babel-preset-es2040'. Do not include the full package name in most cases.
Node API usage
require('babel-core').transform('code', { presets: ['es2040'] })
require('babel-core').transform('code', { presets: [require('babel-preset-es2040')] })
Passing the preset object directly is also valid but unnecessary. The string name works via Babel's resolution.

Install the preset, configure .babelrc to use it, and compile a JavaScript file with Babel CLI.

npm install --save-dev babel-preset-es2040 # .babelrc { "presets": ["es2040"] } # Then run babel on your files npx babel script.js --presets es2040
Debug
Known issues
deprecatedPackage is no longer maintained and may not work with modern Babel versions (v7+).
fix
Migrate to babel-preset-env or a custom preset with chosen plugins.
affects: >=1.0.0
breakingBabel 7 dropped support for presets without babel-preset- prefix in the name, requiring full package name in .babelrc.
fix
Use { "presets": ["babel-preset-es2040"] } or switch to a compatible preset.
affects: >=7.0.0
gotchaOnly a tiny subset of ES6 features are supported; most modern syntax will fail to compile.
fix
Check the list of supported plugins in the package source, or use a more comprehensive preset.
affects: all
gotchaPackage name includes 'es2040' but actually targets a subset of ES6 (ES2015), not ES2020.
fix
Do not assume it provides ES2020 features; refer to source for actual plugins.
affects: all
Errors
Common errors & fixes
Module not found: Can't resolve 'babel-preset-es2040' in ...
Babel cannot locate the preset if not installed or if the name resolution is incorrect.
fix
Run `npm install --save-dev babel-preset-es2040` and ensure it's in node_modules.
Error: [BABEL] unknown preset: es2040
Babel 7 requires the full package name if the default resolution fails.
fix
Change .babelrc to {"presets": ["babel-preset-es2040"]}.
SyntaxError: Unexpected token (something like import/const/arrow etc.)
The preset does not include the plugin for that feature.
fix
Use a different preset like babel-preset-env that supports the needed syntax.
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
8
OpenAI (training)
1
Resources
babel-preset-es2040 — npm install babel-preset-es2040 · libregistry