react-transform-jspm-hmr

1.0.1 • Public • Published

react

A React Transform that enables hot reloading React classes using JSPM. Hot module replacement is supported via jspm-hot-reloader and systemjs/plugin-babel. This is based on react-transform-hmr by Dan Abramov.

Installation

First, install the Babel plugin:

jspm install react-transform=npm:babel-plugin-react-transform

Then, install the transform:

jspm install npm:react-transform-jspm-hmr

Configuration

For now, you have to download babel-plugin manually and edit options.plugins to ["react-transform"].

In your config.js:

{
  babelOptions: {
    "optional": [
      "runtime",
      "optimisation.modules.system"
    ],
    "extra": {
      "react-transform": {
        "transforms": [{
          "transform": "react-transform-hmr"
        }]
      }
    }
  }
}

Then load the files you wish to transform with the import jsx from './component!babel' syntax or use a meta in config.js

{
  meta: {
    "some/files/*": {
      "loader": "babel-loader"
    }
  }
}

License

MIT

Package Sidebar

Install

npm i react-transform-jspm-hmr

Weekly Downloads

2

Version

1.0.1

License

MIT

Last publish

Collaborators

  • beardon