You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has become a major pain point for me in Gulp 4.
I have tasks that I will want to have occur both when a file is added and removed from the file system.
What were you expecting to happen?
I have this basic code where it watches my sass files. If I add or remove an scss file from the folder structure, I want my sass task to do a full re-compile (ie. do extra stuff like generating new files). If I just make changes it only does a basic compile with whatever files already exist.
I would also want the 'sass:+extra' task to run when a sass file is renamed. And it does... however...
What actually happened?
When I rename a file, it will run 'sass:+extra' twice.
I understand why it does this. I'm both adding and removing a file from the file system at the same time and thus I'm triggering both events and firing the task twice.
This is very difficult to work around. Debounce functions don't even seem to prevent it.
If there was a gulp.watch().on('rename') feature that paid attention to files that are being added and removed from the file system simultaneously, and blocked the unlink and add events from firing when the event is triggered, it would solve the issue.
So ideally, I would want to be able to write Pug code like this, and only have the sass:+extra task run only once based on the action that occurred:
We return a chokidar instance, so you should ask them on their repository. I'm guessing they will say no because it's not a trivial thing and the native libraries don't expose it.
This has become a major pain point for me in Gulp 4.
I have tasks that I will want to have occur both when a file is added and removed from the file system.
What were you expecting to happen?
I have this basic code where it watches my sass files. If I add or remove an scss file from the folder structure, I want my sass task to do a full re-compile (ie. do extra stuff like generating new files). If I just make changes it only does a basic compile with whatever files already exist.
I would also want the
'sass:+extra'
task to run when a sass file is renamed. And it does... however...What actually happened?
When I rename a file, it will run
'sass:+extra'
twice.I understand why it does this. I'm both adding and removing a file from the file system at the same time and thus I'm triggering both events and firing the task twice.
This is very difficult to work around. Debounce functions don't even seem to prevent it.
If there was a
gulp.watch().on('rename')
feature that paid attention to files that are being added and removed from the file system simultaneously, and blocked theunlink
andadd
events from firing when the event is triggered, it would solve the issue.So ideally, I would want to be able to write Pug code like this, and only have the
sass:+extra
task run only once based on the action that occurred:What version of gulp are you using?
CLI version 1.2.2
Local version 4.0.0-alpha.2
What versions of npm and node are you using?
node 4.4.7
npm 3.10.6
The text was updated successfully, but these errors were encountered: