-
Notifications
You must be signed in to change notification settings - Fork 88
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
Pass filename to the replace function? #50
Pass filename to the replace function? #50
Comments
This is a very useful enhancement, and something that we should definitely include before 1.0.0 to avoid a breaking change. This would change the function signature for regex replace, which way introduce an incompatibility with streaming regex replace. We'll have to explore further to know. |
Using stream as source and destination of replacement is great. |
So I'm looking into trying and get that file functionality implemented. Since it technically is optional, I'm thinking of adding a RegExp option in the Options object to allow the user to specify with a regex string which files will receive this replace treatment. Having it in the options object would keep any existing users from receiving breaking changes. |
However, if you're in need of this kind of functionality now, this plugin should accomplish what you need. https://github.com/sindresorhus/gulp-filter |
Yeah, and it keep everything KISS ;) |
+1 for this enhancement... i am working on something similar whereby i replace a string with the current file name in the pipe.
|
I cannot get this to work at all, just trying to replace a file path from the server with a local one for debug...
I've tried it with and without the filter, tried wrapping the original text in new String('...') to prevent thinking its a RegEx, even tried a completely different string with no special characters, nothing is working. Any thoughts??? |
Closed by 99474b3. |
Could you pass an argument filename to the replace function ?
The text was updated successfully, but these errors were encountered: