The dev, staging and production versions of our projects can vastly vary, which is one reason we may need to change paths to resources (scripts/styles/templates), generated markup or other content based on environment and target-specific information. Luckily there exist a number of build tasks in the Grunt, Gulp and Broccolli eco-systems that can help us here.
Today I’ll cover three approaches to this problem – string replacement, conditional comments and template variables. The option you end up choosing will likely depend on where you’re happy for the bulk of your conditional logic to exist. Continue Reading →