V
V
virtualhero2017-08-19 17:06:57
React
virtualhero, 2017-08-19 17:06:57

Why is hot-loader not working?

I set a lesson from the loftblog and the official dock.
Webpack config:
`

const path = require('path');

module.exports = {

  entry: {
    'app': [
      'babel-polyfill',
      'react-hot-loader/patch',
      './src/index'
    ]
  },

  output: {
    path: path.join(__dirname, 'public'),
    filename: 'bundle.js'
  },

  module: {
    rules: [
      { test: /\.js$/, exclude: /node_modules/, loader: "babel-loader" }
    ]
  }

};

.babelrc:
{
  "presets": ["react", "es2015"],
  "plugins": ["react-hot-loader/babel"]
}

the dev server itself is updated with changes but the states are reset.
what am i doing wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question