Closed jimbojsb closed 8 years ago
I'm cool with removing it entirely. I've never had a need for it. It just seemed like, for certain folks and environments, it refused to work unless they enabled polling.
Regarding high CPU usage when in watch mode, see this (merged) pull request and this ticket.
All in all we should add the ignored
option to watchOptions
. This drops cpu usage dramatically (for me: from 30% to 2%). Disabling polling and ignoring node_modules
drops to < 1%
// webpack.config.js
module.exports = {
watchOptions: {
poll: false,
ignored: /node_modules/
}
}
Okay done.
@jimbojsb
The specific environment where polling is an issue is Docker for Mac, which doesn't need it anyway since it has real inotify events inside the containers.
Can you clarify what you mean here? I'm using Docker for Mac, and watching files is not working. It works only if polling is enabled, which I'd like to avoid to reduce CPU usage.
Do you happen to be using PHPStorm?
I am, although I don't see how it's related to this issue. I run the node watcher manually on my terminal.
Try disabling safe file saving. Storm'a auto save makes a new file and then replaces the old one which is not an event that is proxied by docker for mac.
Ostensibly, this commit: https://github.com/JeffreyWay/laravel-elixir-webpack-official/commit/8b66f2c1684d4aae9d4072aa9437e104e3188cfe
Ideally this would respect the optional polling configuration that was recently added to Elixir 6.0.0-11
The specific environment where polling is an issue is Docker for Mac, which doesn't need it anyway since it has real inotify events inside the containers.