gaearon / react-hot-boilerplate

Minimal live-editing example for React
MIT License
3.91k stars 879 forks source link

Use webpack-dev-middleware #68

Closed adam-beck closed 7 years ago

adam-beck commented 8 years ago

Closes #65

bradleyboy commented 8 years ago

@adam-beck FYI - I walked through this and it works as expected, but webpack-hot-middleware needs to be added to package.json.

adam-beck commented 8 years ago

Hmm not sure how I missed that. I made the changes but don't know if I used the correct workflow to get these into Github. There are 2 commits with the same message now.

pkese commented 8 years ago

Hey @adam-beck,

Any chance you'd port this to version 3 as well? I'm clueless about what what to include into webpack.config's entry array.

bradleyboy commented 8 years ago

@pkese I'm using this on v3, here's the entry:

entry: [
  'react-hot-loader/patch',
  'webpack-hot-middleware/client',
  './src/index'
],
iamyardem commented 8 years ago

Hello @bradleyboy

I've tried do like you wrote above but I receive error "[HMR] Hot Module Replacement is disabled." And nothing renders. I've checked bundle path, it can be resolved from index.html.

I've created repo with my non working code. If you have a chance to look at it, please help :)

Thanks!

https://github.com/iamyardem/react-redux-webpack-universal-app

bradleyboy commented 8 years ago

@iamyardem Nothing stands out to me, but your repo has changed quite a bit from the default. Here's a branch of v3 with middleware for reference: https://github.com/gaearon/react-hot-boilerplate/pull/72

ghost commented 8 years ago

I'd vote in favor of not using the middleware over the dev-server. This PR adds a lot of green lines to the diff, but what does it do to better demonstrate hot-reloading?

calesce commented 7 years ago

Thanks!