Reputation: 1463
I'm creating a website using Foundation 6 (based on the Zurb template) I want to use some HTML (namely, Google Analytics) that's meant to be added only if the gulp's production flag is set.
How can I accomplish that?
Upvotes: 0
Views: 162
Reputation: 324
I have used gulp-string-replace
to do things like this. I set a unique string in the HTML such as <!-- {{{GA_CODE}}} -->
and have gulp replace the string if the production flag is set.
https://www.npmjs.com/package/gulp-string-replace
You could use this with something like gulp-if
https://github.com/robrich/gulp-if
Upvotes: 1