简体   繁体   中英

How to pass params to plugins in presets in babel 6?

I have a react preset , and I want to pass pragma params to transform-react-jsx.

For now I'm installing transform-react-jsx separatly and set my .babelrc like so:

{
  "presets": [
    "react"
  ],
  "plugins": [
    ["transform-react-jsx", {
      "pragma": "dom.hJSX"
    }]
  ]
}

But I wonder if there is another way to pass settings to plugins in presets.

So I got to babel github and as I found out now there is no way to pass settings to plugins in presets.

On the bright side there is another discussion that could turn into something sometime sooner or later.

UPD: babel moved all issues to phabricator and these discussions seem to be lost forever. However this feature seems to be a step forward towards solving the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM