#7277·babel

[preset-env] target.node=true should use package.engines.node

Author: julien-fCreated Jan 26, 2018Updated Sep 2, 2026
Labelshelp wantedpkg: preset-env

Is this a bug report or feature request?

Feature request

Input Code

javascript
var your => (code) => here;

Babel/Babylon Configuration (.babelrc, package.json, cli command)

javascript
{
  presets: ['env', { targets: { node: true } }]
}

package.json:

json
{
  "engines": {
    "node": ">=6"
  }
}

Expected Behavior

It should target the Node version specified in package.engines.node.

Current Behavior

It targets the current Node version.

Possible Solution

current should still use the current version, but true could use package.engines.node.

Context

I currently have to maintain in sync the targeted Node version both in package.json and in the Babel config.

Your Environment

software version(s)
Babel
Babylon
node
npm
Operating System