Running webpack with watch in Bash on Ubuntu on Windows builds once and exits

chi*_*t24 5 webpack windows-subsystem-for-linux

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
}
Run Code Online (Sandbox Code Playgroud)

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.

SM7*_*M79 0

webepack --watch从 Windows 命令提示符运行。我知道这可能并不理想,但它对我有用。