zambezi / ez-build

Zambezi build tool
MIT License
2 stars 1 forks source link

Some glob patterns not possible with `--include` and `--exclude` #39

Closed mstade closed 7 years ago

mstade commented 7 years ago

Expected Behavior

@DimitarChristoff mentioned in his review of #37, that it should be possible to set an include (or exclude) pattern like this:

ez-build --include "js:**/*.{js,jsx}"

Current Behavior

Unfortunately, it seems that ez-build doesn't support {x,y} glob patterns, probably because it splits the patterns on , characters. Indeed, running the above command with DEBUG=1 shows the result of parsing the pattern:

$ DEBUG=1 ez-build --include "js:**/*.{js,jsx}"
...
# - include: {"js":["**/*.{js","jsx}"],"css":["jsx}"],"*":["jsx}"],"copy-files":["**/*"]}       src/main.js:27
...

This issue affects --exclude as well, as they use the same logic.

DimitarChristoff commented 7 years ago

http://requirebin.com/?gist=384c1319fa264c8b5896c6db702c21b0 - though this relies on whatever file matching you pass it on to rely on regex matches for extension or whatever.

DimitarChristoff commented 7 years ago

/.(js|jsx)$/, is popular also.