如何在babel 6中定义插件设置

How to define plugin settings in babel 6?

本文关键字:定义 插件 设置 babel      更新时间:2023-09-26

我尝试过使用babel 5.x样式,带有extra选项,但它不起作用。

插件可以指定选项。您可以在配置中这样做,方法是将其封装在一个数组中并提供一个选项对象。例如:

{
  "plugins": [
    ["transform-async-to-module-method", {
      module: 'bluebird',
      method: 'coroutine'
    }]
  ]
}

发件人https://github.com/babel/babel.github.io/pull/513