Open vjirovsky opened 9 years ago
You are right, it seems like the replacement is just done once. Unfortunately I am not able to do fix, test and release this right now, but feel free to change the following lines https://github.com/PaulTondeur/grunt-cache-busting/blob/master/tasks/cache-busting.js#L23 https://github.com/PaulTondeur/grunt-cache-busting/blob/master/tasks/cache-busting.js#L41 and change the RegExes to global replacements instead and make a pull request for it.
Paul
I am just pondering over the regex "((\-?)(.+)*)"
on cache-busting.js#L41.
Considering this particular use case of
<script type="text/javascript" src="js/main.js"></script><script>main.js</script>
the new RegExp('main((-?)(.+)*).js', 'g')
will clobber the second instance of main.js
and produce undesirable behaviour.
Hello,
I use grunt-cache-busting tasks also for cache cleaning of sprite image (when I create new sprite by another task, the result is new Less file, but referencing to sprite image with no version), so I clean Less file by:
_But cache-busting makes changes only for first apperance in file: _
Is there some parameter to force replace all apperance?
Thanks, Vaclav!