Closed ve3 closed 2 years ago
This example is too complex. Please provide a simplified test case that we can check. Ideally this will be a repository that can be cloned.
This example is too complex. Please provide a simplified test case that we can check. Ideally this will be a repository that can be cloned.
I've updated the content.
Can you please update the example to be idiomatic gulp code? Your copyPath
function is async
but also tries to return a stream, which is entirely invalid. Additionally, the function is being called inside an event handler instead of the gulp task system. We don't support this type of non-idiomatic code. If you need help writing idiomatic gulp, I can move this to Discussions where a community member might be able to help out.
It is async
because I use with await del()
. The problem is patterns in src()
work diffently with watch()
that's. The problem is not in copyPath()
.
Even if you use more simple like series()
after watch()
it is still not work the same with src()
that is the main problem.
I think this is not discussion type, it is the problem that your src()
and watch()
work differently with the same patterns.
If you don't think that this is the problem it's okay to close the issue.
Before you open this issue, please complete the following tasks:
What were you expecting to happen?
The glob pattern use in
gulp.watch
should work the same way withgulp.src
.What actually happened?
The negative character (
!pattern
) should filtered out the path. They did ingulp.src
but did not ingulp.watch
even they both have the same options.For example: I filtered out tests folder.
gulp copy
then it works fine because it usegulp.src()
.gulp watch
and make change to somewhere such as tests/readme.txt, it should be skipped but it just copy this file to target path.Folder structure for D:/wwwroot/_test/gulp-test
Please give us a sample of your gulpfile
Terminal output / screenshots
Please provide the following information:
node -v
):npm -v
):gulp -v
):Additional information
Use dot prefix or without dot prefix (!./tests, !tests) as described here don't change anything.
This seems to be resolved in https://github.com/gulpjs/gulp/issues/2340 but it doesn't. Because from my paths.json file, the source path is using / as directory separator but still not working.
Packages required for testing: gulp, del, gulp-print.