Skip to content
This repository was archived by the owner on Mar 31, 2020. It is now read-only.

Added ability to configure watch #641

Merged
merged 1 commit into from
Sep 13, 2016

Conversation

jeffturcotte
Copy link
Contributor

@jeffturcotte jeffturcotte commented Sep 13, 2016

Allow gulp watch to be configured. This addressed the problem in #586 for me on a Linux system as I was able to disable polling.

The defaults are the same as they were prior to this commit: polling at a 1s interval.

Thanks!

@JeffreyWay
Copy link
Contributor

Now I'm wondering if polling should be disabled by default. I've never had a need for it.

@jonnywilliamson
Copy link

@JeffreyWay

Sorry if this is completely stupid, but is the polling not required if someone is using a virtual machine (like homestead) otherwise file changes can't be picked up?

JeffreyWay/laravel-elixir-webpack-official#15

Or is this a completely different issue?

@JeffreyWay
Copy link
Contributor

I'm not sure. Seems like some folks on VMs have no problem at all, while others do. It's tricky. Either way, this PR will let anyone turn it off or on... it's just a matter of what we default to.

I've heard reports of polling sending CPUs to 100%.

Or maybe there's a way to set it dynamically. Not sure how to detect that though.

@jeffturcotte
Copy link
Contributor Author

Tough issue. Nobody wants CPU going through the roof, but polling is the silver bullet that works everywhere regardless of filesystem event support, slow VFS mounts in VirtualBox, etc.

@jonnywilliamson
Copy link

Sure. I've no problems with it being a config option naturally, that seems very useful.

Just for a recap (as I'm sure your head must spin trying to remember details of dozens of issues) - The reports of CPU's going to 100 was from here: https://github.com/laravel/elixir/issues/586

And the best explanation of why it doesn't work in VMs (although why only some VMs does seem to be strange) comes from this short article which explains it very well.

http://andrewhfarmer.com/webpack-watch-in-vagrant-docker/

(Thanks for work you do with this package though. Left to my own devices I'd never get round to getting gulp/webpack to work properly.)

@JeffreyWay
Copy link
Contributor

Thanks for the recap. Definitely helps.

I'm going to merge this. Thanks for the PR @jeffturcotte!

@JeffreyWay JeffreyWay closed this Sep 13, 2016
@JeffreyWay JeffreyWay reopened this Sep 13, 2016
@JeffreyWay JeffreyWay merged commit 3d7ff60 into laravel:master Sep 13, 2016
@liorocks
Copy link
Contributor

Quick question on that note, what does usePolling param do?

@tariq86
Copy link

tariq86 commented Sep 20, 2016

@landish it changes how files are watched; see the first option underneath the "Performance" section: https://github.com/paulmillr/chokidar#performance

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants