confused with babel preset configs between @babel/env and @babel/preset-env

Maybe they are same?

That is correct, the preset- piece is optional. Since you are doing

presets: ["@babel/env"]

Babel already knows that it is a preset since it is in the presets array, so it will add the preset- into the module name automatically.

This applies to plugins as well.

See the table in the Babel issue where this was implemented for more examples.

Leave a Comment