I’ve been trying to figure out a way to cache bust images with Grunt.
I found grunt-cache-bust but I can’t get it to work since it gets tripped up with the whole '<?php bloginfo('stylesheet_directory'); ?>/' in image urls. I tried setting that string as the baseDir but that didn’t work at all…
If it’s relevant, the images are in the same directory as my Gruntfile. Ideal scenario would be that it ignores that prefix.
I mostly have it figured out for script/style enqueues— I’m talking about static assets such as images (am I just doing all of this wrong..?) which I can’t find a work-around for.
I guess to elaborate on what I’m working with:
grunt-cache-bust goes through a given file and appends a hash to all static asset requests, and then appends the same hash to the file itself. Since I’m working on a WordPress theme, all of the image sources are relative to <?php bloginfo('stylesheet_directory'); ?> which is tripping up the grunt module.
Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Back End’ is closed to new topics and replies.