alisa kibin
alisa kibin

Reputation: 582

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.

Upvotes: 6

Views: 1796

Answers (1)

alisa kibin
alisa kibin

Reputation: 582

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.

Upvotes: 2

Related Questions