{"id":19290,"library":"babel-preset-es2040","title":"babel-preset-es2040","description":"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.","status":"deprecated","version":"1.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/ahdinosaur/babel-preset-es2020","tags":["javascript","babel","preset","es2020","es2040","tc39","es6","es2015","es2016"],"install":[{"cmd":"npm install babel-preset-es2040","lang":"bash","label":"npm"},{"cmd":"yarn add babel-preset-es2040","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-preset-es2040","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This preset is a CommonJS module. ESM import will fail unless using a bundler that handles CJS interop.","wrong":"import preset from 'babel-preset-es2040'","symbol":"default export","correct":"module.exports = require('babel-preset-es2040')"},{"note":"Babel resolves the preset name 'es2040' to the package 'babel-preset-es2040'. Do not include the full package name in most cases.","wrong":"{\"presets\": [\"babel-preset-es2040\"]}","symbol":".babelrc config","correct":"{\"presets\": [\"es2040\"]}"},{"note":"Passing the preset object directly is also valid but unnecessary. The string name works via Babel's resolution.","wrong":"require('babel-core').transform('code', { presets: [require('babel-preset-es2040')] })","symbol":"Node API usage","correct":"require('babel-core').transform('code', { presets: ['es2040'] })"}],"quickstart":{"code":"npm install --save-dev babel-preset-es2040\n# .babelrc\n{\n  \"presets\": [\"es2040\"]\n}\n# Then run babel on your files\nnpx babel script.js --presets es2040","lang":"javascript","description":"Install the preset, configure .babelrc to use it, and compile a JavaScript file with Babel CLI."},"warnings":[{"fix":"Migrate to babel-preset-env or a custom preset with chosen plugins.","message":"Package is no longer maintained and may not work with modern Babel versions (v7+).","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use { \"presets\": [\"babel-preset-es2040\"] } or switch to a compatible preset.","message":"Babel 7 dropped support for presets without babel-preset- prefix in the name, requiring full package name in .babelrc.","severity":"breaking","affected_versions":">=7.0.0"},{"fix":"Check the list of supported plugins in the package source, or use a more comprehensive preset.","message":"Only a tiny subset of ES6 features are supported; most modern syntax will fail to compile.","severity":"gotcha","affected_versions":"all"},{"fix":"Do not assume it provides ES2020 features; refer to source for actual plugins.","message":"Package name includes 'es2040' but actually targets a subset of ES6 (ES2015), not ES2020.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install --save-dev babel-preset-es2040` and ensure it's in node_modules.","cause":"Babel cannot locate the preset if not installed or if the name resolution is incorrect.","error":"Module not found: Can't resolve 'babel-preset-es2040' in ..."},{"fix":"Change .babelrc to {\"presets\": [\"babel-preset-es2040\"]}.","cause":"Babel 7 requires the full package name if the default resolution fails.","error":"Error: [BABEL] unknown preset: es2040"},{"fix":"Use a different preset like babel-preset-env that supports the needed syntax.","cause":"The preset does not include the plugin for that feature.","error":"SyntaxError: Unexpected token (something like import/const/arrow etc.)"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}