whatisgithub

What is babel-preset-env?

mcav/babel-preset-env — explained in plain English

Analysis updated 2026-08-08 · repo last pushed 2017-10-04

JavaScriptAudience · developerComplexity · 2/5DormantSetup · easy

In one sentence

Babel preset that automatically determines which JavaScript transformations to apply based on the specific browsers or Node.js versions you need to support, producing smaller output by skipping unnecessary translations.

Mindmap

mindmap
  root((babel-preset-env))
    What it does
      Translates new JS to old JS
      Picks minimum transforms needed
      Skips already-supported features
    How it works
      You set target environments
      Checks feature support database
      Smaller compiled output
    Integration
      Works with browserslist
      Shared config across tools
      Debug option for visibility
    Use cases
      Support older browsers
      Target specific Node version
      Team debugging with debug mode
    Design choices
      Only finalized features
      Stable not experimental
      Include and exclude overrides
    Audience
      Web developers
      Node.js developers
      Teams shipping JS

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Ship JavaScript that works on older browsers like IE 10 by targeting those environments directly.

USE CASE 2

Skip unnecessary translations in a Node.js app by targeting your specific Node version.

USE CASE 3

Use the debug option to see exactly which Babel plugins are being applied and why.

USE CASE 4

Configure supported browsers once via browserslist and share that config across Babel, Autoprefixer, and other tools.

What is it built with?

JavaScriptBabelNode.jsbrowserslist

How does it compare?

mcav/babel-preset-env00kaku/gallery-slider-block0verflowme/weirdhta
LanguageJavaScriptJavaScriptJavaScript
Last pushed2017-10-042021-05-192022-06-16
MaintenanceDormantDormantDormant
Setup difficultyeasyeasymoderate
Complexity2/52/52/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Install via npm as part of your existing Babel setup and add targets to your .babelrc or babel.config.js, no external infrastructure required.

This project is open source and free to use for any purpose, consistent with typical permissive JavaScript ecosystem licenses.

So what is it?

Modern JavaScript keeps getting new features, but not every browser or runtime environment supports them yet. Babel is a tool that translates new JavaScript into older JavaScript that runs everywhere. The challenge is figuring out exactly which translations to apply, applying all of them unnecessarily bloats your code. babel-preset-env solves this by automatically determining the minimum set of transformations needed based on the specific environments you actually need to support. You tell it your target environments, for example, "the last two versions of every major browser" or "Node.js 6.10", and it checks a database of which JavaScript features those environments already support natively. Anything they don't support gets translated, anything they already handle stays as-is. The result is smaller compiled output with no unnecessary translations. It also integrates with browserslist, a shared configuration format that other front-end tools like Autoprefixer use, so you can define your supported browsers in one place and have multiple tools respect it. This is useful for any web developer or team shipping JavaScript to real users. If you're building a product that needs to work on older browsers like IE 10, you'd configure your targets accordingly and get exactly the polyfills and code transformations that environment requires, no more, no less. If you're building a Node.js application, you can target your specific Node version and skip translations for features Node already supports. Teams can also use the debug option to see exactly which plugins are being applied and why, which helps with understanding what's happening under the hood. One notable design choice is that it only includes transformations for finalized JavaScript features, not experimental proposals still making their way through the standards process. This keeps things stable, you won't accidentally rely on syntax that might change before becoming official. The project also offers fine-grained control through include and exclude options for edge cases where you need to override the automatic behavior, such as working around a bug in a browser's native implementation of a feature.

Copy-paste prompts

Prompt 1
Set up babel-preset-env to target the last 2 versions of all major browsers and Node.js 18, and show me the .babelrc configuration.
Prompt 2
Configure babel-preset-env with the debug option enabled so I can see which transformations are being applied and why in my build output.
Prompt 3
Add include and exclude options to my babel-preset-env config to force-enable a specific transformation while skipping another that is causing issues in my target browser.
Prompt 4
Integrate babel-preset-env with a browserslist config so that my Babel setup and Autoprefixer both respect the same list of supported browsers.
Prompt 5
Compare the compiled output size of babel-preset-env targeting IE 10 versus targeting only evergreen browsers so I can see the difference in translation count.

Frequently asked questions

What is babel-preset-env?

Babel preset that automatically determines which JavaScript transformations to apply based on the specific browsers or Node.js versions you need to support, producing smaller output by skipping unnecessary translations.

What language is babel-preset-env written in?

Mainly JavaScript. The stack also includes JavaScript, Babel, Node.js.

Is babel-preset-env actively maintained?

Dormant — no commits in 2+ years (last push 2017-10-04).

What license does babel-preset-env use?

This project is open source and free to use for any purpose, consistent with typical permissive JavaScript ecosystem licenses.

How hard is babel-preset-env to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is babel-preset-env for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.