How to disable babel transform-regenerator completely

梦想的初衷 提交于 2019-12-05 10:19:18

问题


I'm looking for a way to completely disable generator functions transform with babel. With babel 5 there was a blacklist option, but it seems that with babel 6 there is no way to do that (at least I did not find any documentation on the official website).

My current configuration

{
  "presets": [
    "react",
  ],
  "plugins": [
    "transform-object-rest-spread",   
  ]
}

Disabling it like described here https://babeljs.io/docs/plugins/transform-regenerator/ did not help.

Any ideas?


回答1:


Have you tried "exclude"? Like:

{
   "presets": [
      ["env", {
         "exclude": ["transform-regenerator"]
      }]
   ]
}

Please see https://babeljs.io/docs/plugins/preset-env/#optionsexclude for details.



来源:https://stackoverflow.com/questions/43959126/how-to-disable-babel-transform-regenerator-completely

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