Time to update "Delete files and folders" documentation? #2681
Unanswered
SamuelMiller
asked this question in
Ideas
Replies: 1 comment
-
I have a similar problem related to ESM modules. I am trying to upgrade |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
IMHO, it's time to update the gulp "Delete Files and Folders documentation" to either replace the vinyl path plugin with an alternative, or provide an example of how to load it as an ESM within a commonJS gulpfile.js, or of how to use it with the newish fix-esm plugin ((https://git.cryto.net/janwirth/fix-esm) to simplify the process. Vinyl path is now an ESM module making it a lot more complex to use in a commonJS gulpfile.js project--beyond my know-how.
In the good old days, one could do something similar to the following:
But with the more recent vinyl-path update, running my above function produces the dreaded "ERR_REQUIRE_ESM".
I tried playing with loading an ESM module within gulpfile.js, but its syntax is too complex for me as a novice.
Instead, I've gone back to the depreciated, but much appreciated, "gulp-clean", for now. Although I would like to see how to use vinyl-pulgin with the newer fix-esm plugin, there is not enough documentation for me to understand to do so--it somehow involves Babel.
Here is my current working code going back to gulp-clean:
(1) match filenames with any capital letters, (2) delete them, (3) rename them to lowercase, and (4) pipe the result into the same directory
Beta Was this translation helpful? Give feedback.
All reactions