npm.io
0.0.1 • Published 4 years ago

build-plugin-sto-react-hmr

Licence
MIT
Version
0.0.1
Deps
1
Size
4 kB
Vulns
0
Weekly
0

Build Plugin Sto React Hmr

build hot module replace for react project

Getting Started

installation

Add via npm

$ npm install build-plugin-sto-react-hmr --save-dev
$ npm install react-hot-loader @hot-loader/react-dom
Usage
  • Import react-hot-loader in your entry file (before import React)
import 'react-hot-loader';
  • Mark your root component as hot-exported
// App.js
import { hot } from 'react-hot-loader/root';
const App = () => <div>Hello World!</div>;
export default hot(App);
  • edit build.json file
 "plugins": [
    ....
    "build-plugin-sto-react-hmr",
  ]
效果

Image text

Keywords