react-transform-webpack-hmr

React Transform equivalent to React Hot Loader

react-transform-webpack-hmr has been renamed to react-transform-hmr. Please update the package name in package.json and your Babel configuration.
Last updated 5 years ago by gaearon .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install react-transform-webpack-hmr 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.1.6                                ...           latest (5 years ago)

7 Versions

  • 0.1.6 [deprecated]           ...           5 years ago
  • 0.1.5 [deprecated]           ...           5 years ago
  • 0.1.4 [deprecated]           ...           5 years ago
  • 0.1.3 [deprecated]           ...           5 years ago
  • 0.1.2 [deprecated]           ...           5 years ago
  • 0.1.1 [deprecated]           ...           5 years ago
  • 0.1.0 [deprecated]           ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 7
Dependencies (2)
Dev Dependencies (2)

Copyright 2014 - 2016 © taobao.org |