webpack-dev-server does not watch for my file changes

In order to get webpack to watch my file changes (Ubuntu 14.04), I had to increase the number of watchers (I had increased the number before, but it was still too low):

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Source in the official docs: https://webpack.github.io/docs/troubleshooting.html#not-enough-watchers

I first suspected the cause to be fsevents which doesn’t work on Ubuntu, but this apparently wasn’t the case.

Furthermore, because now the watching and re-compiling worked, but the automatic browser refresh part didn’t work, I added the --inline param to the answer of @deowk which enables the “inline mode”:
webpack-dev-server --content-base ./ --port 9966 --hot --inline

Quote from the official docs: “The easiest way to use Hot Module Replacement with the webpack-dev-server is to use the inline mode.”
Source: https://webpack.github.io/docs/webpack-dev-server.html#hot-module-replacement

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)