klei/grunt-injector — pull request #3 by DaftMonk (2014-04-28 07:15:33+00:00)
Title: Clear existing content between start/end tags before injection

Thanks for the great work on this task, its very helpful.

I ran into an issue where if you delete a file that was injected, the injector will not clear the left over reference the next time it's run if it can't match any files to inject.

In other words, if I have

And i delete the script.js file, the next time the task runs it won't match any files to be injected, so it wont delete the incorrect script tag.

This PR fixes this by clearing the content between all start and the end tags before injecting files.