Answer the question
In order to leave comments, you need to log in
How to properly run React-hot-loader?
webpack.config.js:
var path = require('path')
var webpack = require('webpack')
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: [
'webpack-hot-middleware/client',
'babel-polyfill',
'./src/index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
module: {
loaders: [
{
loaders: ['babel-loader'],
include: [
path.resolve(__dirname, "src"),
],
test: /\.js$/,
plugins: ['transform-runtime'],
}
]
}
}
Module build failed: Error: React Hot Loader: The Webpack loader is now exported separately. If you use Babel, we recommend that you remove "react-hot-loader" from the "loaders" section of your Webpack configuration altogether, and instead add "react-hot-loader/babel" to the "plugins" section of your .babelrc file. If you prefer not to use Babel, replace "react-hot-loader" or "react-hot" with "react-hot-loader/webpack" in the "loaders" section of your Webpack configuration.
at Object.warnAboutIncorrectUsage (/home/dragger/my_projects/Redux/node_modules/react-hot-loader/lib/index.js:7:11)
@ multi main
{
"presets": ["es2015", "stage-0", "react"],
"plugins": ["react-hot-loader/babel"]
}
Answer the question
In order to leave comments, you need to log in
after a long dance with a tambourine, I noticed with amazement that my licked config is doing something wrong and the application does not work in the muzzle .... after that I switched to create-react-app
if you are a ninja, this is probably not your way, but I'm happy
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question