I have a situation where I try to use grunt to use code excluding certain folders.
grunt uses the minimal (similar to bsdglob) under the hood to match files, but I can't figure out how to make the .gitignore style exclude the folder.
I would like to swallow this:
ignoreme
and map them:
/folder/path/here/to/something/ok.js /another/folder/path.js /test.js
but do not match these:
/folder/ignoreme/something.js /folder/path/here/to/ignoreme/metoo/file.js
This will match everyone, including ignoreme:
*.js
So, I decided that I could do something like:
!(ignoreme)*.js
but this corresponds to the files in the ignoreme folder.
I'm used to regular expressions, but can't figure out how to repeat a pattern or anything like that. I also tried things like:
/(!(ignoreme)|*)*/*.js
I hope that the container will be repeated, but this will not work, it just does not match everyone.
Any way to pass regex to grunt file paths or do it for me?
Update:
Here's how I deal with this problem right now:
var pattern = /\/ignoreme\// var files = grunt.file.expandFiles(arrayOfFilesPassedToMinimatch).filter(function(f){ return !pattern.test(f) })
I will still be interested if the exclusion of the folder is excluded during the minimization process.
Jesse Sep 28 2018-12-12T00: 00Z
source share