Is there some way to get webpack --watch
to work on Bash on Ubuntu on Windows?
I am running Ubuntu on Windows and webpack --watch
runs once and exits, without errors, as if I simply ran only webpack
.
Increasing the inotify
file watch limit doesn't work; in /etc/sysctl.conf
I have fs.inotify.max_user_watches=524288
.
Update: Adding the following to my webpack.config.js
file works:
watch: true,
watchOptions: {
poll: true,
aggregateTimeout: 300,
number: 1000
}
But it causes my CPU usage to spike to 100%, making this solution impractical.
Update 2: There might be some more useful info on the issue here: https://github.com/webpack/webpack-dev-server/issues/155. However, I've switched to working on a Mac and this problem no longer affects me.
Looks like you're running Windows 10 Anniversary Update which didn't yet support INOTIFY file-change event notifications. This capability was added in Insider build 14942 back in Oct 2016:
https://blogs.msdn.microsoft.com/commandline/2016/10/07/wsl-adds-inotify-filesystem-change-notification-support/
Once you upgrade to a recent Insider build, or to Creators Update which will be released this spring, you'll be able to enjoy INOTIFY support which is more efficient than the polling mechanism that your config change enabled.
HTH.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With