I have a pretty simple webpack.config.js like this:
'use strict';
// var webpack = require('webpack');
module.exports = {
devServer: {
contentBase: './static',
stats: {
colors: true
}
},
entry: [
'webpack/hot/dev-server',
'./source/scripts/main.jsx'
],
resolve: {
extensions: ['', '.js', '.jsx']
},
module: {
loaders: [
{
test: /\.jsx$/,
loaders: [
'react-hot',
'jsx?harmony'
]
}
]
},
output: {
filename: 'main.js',
path: './build/js',
publicPath: '/js/'
}//,
// plugins: [
// new webpack.HotModuleReplacementPlugin()
// ]
};
My npm start is webpack-dev-server --config=./webpack.config.js --port=3000 --hot. If I remove --hot and uncomment the hot module replacement plugin from the above config, state is not preserved when modules are updated.
This might be an issue with react-hot-loader, but I couldn't find any documentation on the difference between --hot and the plugin method. Thought I'd ask before diving into source code.
I have a pretty simple
webpack.config.jslike this:My
npm startiswebpack-dev-server --config=./webpack.config.js --port=3000 --hot. If I remove--hotand uncomment the hot module replacement plugin from the above config, state is not preserved when modules are updated.This might be an issue with
react-hot-loader, but I couldn't find any documentation on the difference between--hotand the plugin method. Thought I'd ask before diving into source code.