AlexGilleran/jsx-control-statements

Work with babel-plugin-transform-react-inline-elements?

navgarcha opened this issue · 3 comments

Is it possible to get this plugin to work alongside babel-plugin-transform-react-inline-elements?

I would think it should do - are you putting jsx-control-statements before transform-react-inline-elements in your babelrc? JSX Control Statements will have to run first.

transform-react-inline-elements is actually in the env specific part of my .babelrc and when this is merged in with the 'non-env' config it appears to place transform-react-inline-elements before jsx-control-statements.

It's not neat but i've had todo the following to fix this:

{
    "presets": [
        // ...
    ],
    "plugins": [
        "add-module-exports",
        "react-require"
    ],
    "env": {
        "development": {
            "plugins": [
                "jsx-control-statements"
            ]
        },
        "production": {
            "plugins": [
                "jsx-control-statements",
                "babel-plugin-transform-react-inline-elements"
            ]
        }
    }
}

Thanks for sharing the solution! :)