react-transform-webpack-hmr

v0.1.5
React Transform equivalent to React Hot Loader
react-transform react reactjs webpack hmr live edit hot reload and 3 more...

react-transform-webpack-hmr

A React Transform equivalent to React Hot Loader.

Installation

First, install the Babel plugin:

npm install --save-dev babel-plugin-react-transform

Then, install the transform:

npm install --save-dev react-transform-webpack-hmr

Then edit your .babelrc to include extra.babel-plugin-react-transform.
It must be an array of the transforms you want to use:

{
  "stage": 0,
  "plugins": [
    "react-transform"
  ],
  "extra": {
    // must be defined and be an array
    "react-transform": [{
      "target": "react-transform-webpack-hmr",
      // if you use React Native, pass "react-native" instead:
      "imports": ["react"],
      // this is important for Webpack HMR:
      "locals": ["module"]
    }]
    // note: you can put more transforms into array
    // this is just one of them!
  }
}

Finally, make sure you process files with babel-loader, and that you don’t use React Hot Loader (it’s not needed with this transform).

This transform has no effect when process.env.NODE_ENV is set to 'production'.

License

MIT

Metadata

  • MIT
  • Whatever
  • Dan Abramov
  • released 9/16/2015

Downloads

Maintainers