Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watchers do not detect specific files #84

Open
mvicens opened this issue Nov 26, 2022 · 4 comments
Open

Watchers do not detect specific files #84

mvicens opened this issue Nov 26, 2022 · 4 comments

Comments

@mvicens
Copy link

mvicens commented Nov 26, 2022

Taking this Gulp file:

const { watch } = require('gulp');

function css(cb) {
	cb();
}

function js(cb) {
	cb();
}

function defaultTask(cb) {
	watch('src/**/*.css', css);
	watch('src/scripts/index.js', js);
	cb();
}

exports.default = defaultTask;

And, starting from an empty folder src, ...

  1. Run Gulp command.
  2. Create a CSS file. ✅ It is detected correctly (a "Starting 'css'..." and the appropriate finalization appear in the console).
  3. Change the content of this file. ✅ Detected.
  4. So, put the specific JS file. ❌ Nothing happens.
  5. Change its content. ❌ Nothing.
  6. Rerun command (finish and start again).
  7. Change the CSS content. ✅ Detected.
  8. Change the JS content. ✅ Detected.

Why this behaviour (steps 4 & 5)? Is it a bug, right?

@mvicens mvicens changed the title Watchers does not detect specific files Watchers do not detect specific files Nov 27, 2022
@yocontra
Copy link
Member

yocontra commented Apr 6, 2024

This should be resolved in v5, but feel free to let me know if not and I'll reopen.

@yocontra yocontra closed this as completed Apr 6, 2024
@mvicens
Copy link
Author

mvicens commented Apr 16, 2024

It makes the same. 😢

@yocontra yocontra reopened this Apr 17, 2024
@yocontra yocontra transferred this issue from gulpjs/gulp Apr 17, 2024
@yocontra
Copy link
Member

Seems like the issue is watching a specific file (not a glob) that doesn't exist yet, then when it does exist the change isn't being picked up.

@mvicens
Copy link
Author

mvicens commented Apr 18, 2024

I edited my issue explanation message to clarify more. Please, check it over.

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

No branches or pull requests

2 participants