react-router-tutorial icon indicating copy to clipboard operation
react-router-tutorial copied to clipboard

How to tie '- - hot' so that when you change and save in files, see the changes in the browser

Open yura-master-web opened this issue 7 years ago • 1 comments

yura-master-web avatar Apr 06 '17 10:04 yura-master-web

npm install --save-dev babel-preset-react-hmre

change module section in webpack.config.js

module: {
  loaders: [
    { test: /\.js$/, exclude: /node_modules/, loader: 'babel-loader?presets[]=es2015&presets[]=react&presets[]=react-hmre',
      }
  ]
}

in package.json change scripts section


  "scripts": {
    "start": "webpack-dev-server --inline --content-base --hot"
  },

And that's it, happy live reload ... http://matthewlehner.net/react-hot-module-replacement-with-webpack/

zainulabidin302 avatar May 31 '17 20:05 zainulabidin302