-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Difference between new webpack.HotModuleReplacementPlugin()
and --hot
?
#97
Comments
|
Okay, thanks for the quick feedback! Is there a "config" way to do what |
|
Cool, thanks again for the quick feedback. So, now I have an webpack-dev-server --config=./webpack.config.js --port=3000 --inline --hot … and a webpack.config.js like: 'use strict';
module.exports = {
devServer: {
contentBase: './static',
stats: { colors: true }
},
entry: {
'main': './source/scripts/main.jsx',
'test': 'mocha!./test/manifest.js'
},
resolve: {
extensions: ['', '.js', '.jsx']
},
module: {
loaders: [{ test: /\.jsx$/, loaders: [ 'react-hot', 'jsx?harmony' ]}]
},
output: {
filename: '[name].js',
path: './build/js',
publicPath: '/js/'
}
}; … so my question is, is there a way to achieve this result, but with an webpack-dev-server --config=./webpack.config.js |
yes: in webpack.hot.config.js
|
For what it's worth: I managed to get this all working using |
Confirmed that you have to do both. Add the
|
@pyrotechnick
And 'webpack.dev.config.js' is :
And
It doesn't work well. When I modified |
wow!!! |
There's a typo propagating here: This works |
I tried adding
... nothing... I tried adding
But then I get
Help... |
@rachmann that error means you haven't defined the |
ow - that was a dumb error on my part.. But is still didn't work. Infact, if I remove |
@rachmann glad you got the variable sorted. it should be noted that the issues here aren't support forums. I'd recommend heading to Stack Overflow and posting a question with more details on your setup. |
@shellscape Others have asked questions, but you only ask this of me? I love SO, but if you don't want to answer questions, then answer none. |
@rachmann thanks for the feedback, but you might be taking that a little too personally. we do our best to stay on top of issues when they diverge into support requests. I'd ask that you let that go so the thread can remain on topic. Cheers 🍻 |
I have a pretty simple
webpack.config.js
like this:My
npm start
iswebpack-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.The text was updated successfully, but these errors were encountered: