Skip to content
Alex Gilleran edited this page Jan 7, 2016 · 5 revisions

First up, obviously:

  npm install --save-dev jsx-control-statements

How to use the plugin depends on how you configure Babel:

Node Require Hook

require("babel/register")({
  plugins: ["jsx-control-statements"]
});

CLI

babel --plugins jsx-control-statements script.js

.babelrc

{
  "plugins": ["jsx-control-statements"]
}

Babelify

browserify({
  // etc etc
  transform: [
    babelify.configure({
      plugins: ["jsx-control-statements"]
    })
  ]
});
Clone this wiki locally