-
Notifications
You must be signed in to change notification settings - Fork 126
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
Dynamic target-name resolution via function as argument. #100
Comments
I feel like this could be solved easily with a meta stream tool instead of putting it into the lib. Branching based on filename is a very common use case and shouldn't be built into every single plugin. Have you tried using gulp-if for this? .pipe(gif('a/b/**/*.js', concat('b.js'))
.pipe(gif('a/c/**/*.js', concat('c.js'))
// etc |
Definitely achievable via gulp-if, which is how I have traditionally done it. The idea was to be able to handle JIT target names if the structure of the app is dynamic. This is why I'm putting some feelers out there: to see if this has any philosophical alignment to the project. |
I think gulp-if or other stream meta-tools are the way to handle this since it is such a common thing you would do with other plugins as well |
That's fair. Thanks for the involvement and feedback! |
I've added some functionality on my fork (https://github.com/ktstowell/gulp-concat) that allows the user to pass in a function as the first argument (or as the value of
path
). The returned value would then be used as the target for file contents.Running the test suite would further elaborate what I was trying to accomplish. Basically, with the given glob of:
['scripts/one/**/*.js', 'scripts/two/**/*.js', ''scripts/three/**/*.js']
to result in the contained files of each directory in a dedicated file of the user's choosing - in the case of the test:dist/one.js, dist/two.js, dist/three.js
.I want to submit a PR but in accommodating this new functionality, I have invalidated some tests and was looking for some guidance as to whether they are still meaningful.
(at 48e757a the last test of
4) should calculate relative path from cwd and path in arguments
is failing. It does not seem to be affected by my changes)So if someone could clone my forked repo and run the tests and check out the changes that would be great. If it sounds like something gulp-concat would be interested in I will open a PR.
Thanks!
The text was updated successfully, but these errors were encountered: