-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
Allow function for outFolder in dest #15
Conversation
Looks fine except that basePath is being persisted between files, when it should probably be scoped into the saveFile function when it happens to be a function |
Separately, I have an simple use case to demonstrate the feature: gulp.src('*/assets/*')
.pipe(gulp.dest(function(file) {
return path.resolve(path.dirname(file.path), '../public');
})); Great to know you are interested. I'll look into getting some tests and documentation together later this week. |
Yeah this all looks fine, just needs tests |
+1 for this |
👍 |
+1 for this~ |
Does anyone want to contribute tests/documentation for this so I can merge? |
I'd taken my eye off this one, but will put together the tests this weekend. |
Update? |
We use a PHP framework that stores assets within bundles. We want to use gulp to compile these assets but there are a large quantity of the bundles. It is obviously possible to set up a pipelines for each using a loop, but we would end up with 100's.
I propose allowing passing a function as
outFolder
todest
, so that the input file info can be used to manipulate the output path. I attempted to create a plugin to do this but it just ended up as a copy ofdest
, so decided a PR would be much cleaner. I think this feature will be useful to others, and doesn't add too much code.It's only a proposal at this point so I haven't taken the time to write a test or document it, but if you are interested let me know and I will produce both of these.