-
Notifications
You must be signed in to change notification settings - Fork 31
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
How to find only file name and replace without modify the entire path #63
Comments
If it turns out that there isn't a way to do this using this package you might want to give gulp-markers a try. gulp-html-replace was my inspiration but gulp-markers is basically a thin wrapper around JavaScript's regex. The simplest way to do what your looking at is to define some kind of marker in the file, like
But what it looks like is your decision - it just needs to be uniquely identifiable by a regular expression. Then define the marker object and add it to the markers instance.
You can get more sophisticated by putting all the expressions in a block but that requires writing a pretty ugly regex or doing replace-function regex processing on each line within the block. Apologies to Vladimir if this is inappropriate; I'm happy to delete this comment. I don't recall whether what is being asked is easy to do or not but I ended up writing gulp-markers based on your idea because I kept finding odd corner cases I wanted to address. |
Thanks but kind of complicated. |
I think i found a good solutions, using gulp-replace. |
Hi,
Is it possible to just replace the file name instead replace the entire path?
I have issue that the path is dynamically added.
Example:
Is there a way to just replace the file name?
After run build, i only need to rename the 'app.css' with suffix 'app.min.css' without changing the path and directory.
The text was updated successfully, but these errors were encountered: