Is there a way to replace variables with gulp inside HTML? In my case, I have development HTML files where are paths for images, for e.g. /assets/img/*.jpg, but in production file I need those paths replace with ones which the CMS generates after file uploads. They are completely different and there isn't logic in folder names for e.g. /12365/586/*.jpg.
Im looking for:
- gulp task to replace and generate HTML for development
- gulp task to replace and generate HTML for production
Dev HTML
variable_name_dev = "/assets/img"
variable_name_prod = "/12365/5698"
<img src="variable_name/bg.jpg" alt="Smiley face">
Generated Dev HTML
<img src="/assets/img/bg.jpg" alt="Smiley face">
Generated Production HTML
<img src="/12365/5698" alt="Smiley face">