0

I have webpack configured and when i used to run webpack-dev-server --inline --config webpack.js locally i was working.

Now I am running this command remotely while still reading my local files, but hot reload is not working. Which configuration needs to change for the webpack to read the file changes from local.

And I have tried a lot of stuff that i found around here with no luck.

devServer: {
    contentBase: 'src',
    hot: true,
    inline: true,
    port: 8080,
}
geisterfurz007
  • 5,292
  • 5
  • 33
  • 54

2 Answers2

0

add host:0.0.0.0 in devserver config and start devserver with the flag --host 0.0.0.0. refer here for more details.

sanjay
  • 11
  • 2
0

In my case, using a vanilla create-react-app project, I just added a .env file with parameter HOST set to the actual ip from my dev server and hot-reload started working again.

For more details on parameters available for configuration, check create-react-app docs on Advanced Configuration.

For more details on .env file usage, check create-react-app docs on Adding Development Environment Variables In .env.

Rodriguez
  • 208
  • 1
  • 9