what does the “modules:auto” means in @babel/preset-env field?

若如初见. 提交于 2019-12-01 23:46:23

auto means default value and default value of modules is false. See - https://github.com/babel/babel/pull/8485/files#r236086742.

It seems that the documentation for auto is described in this pull request. According to that PR:

The default auto will automatically select false if ES6 module syntax is already supported by the caller, or "commonjs" otherwise.

So, if ES6 is supported (which seems to be your case) setting modules to auto its the same as setting false.

it enable transformation of ES6 module syntax to another module type.

Reference : https://babeljs.io/docs/en/babel-preset-env#modules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!