pajtai / grunt-useref

Update references, concatenate and minify with build blocks
https://npmjs.org/package/grunt-useref
MIT License
26 stars 8 forks source link

Keep build blocks after renaming #10

Open niksumeiko opened 10 years ago

niksumeiko commented 10 years ago

Build blocks are removed after renaming. This prevents continues renaming for future versions deploys.

According to the documentation, HTML tag that includes the file to be renamed wrapped into build block is replaced with just a HTML tag with a new filename. So, build block with its contents:

<!-- build:js ./main-<%= grunt.file.readJSON('package.json').version %>.js -->
<script src="./main.js"></script>
<!-- endbuild -->

is replaced with just its contents with an updated filename:

<script src="./main-1.0.2.js"></script>

When a new static resources version is ready to be deployed, executing Grunt task grunt useref is not renaming filenames anymore. It happens only because build comment blocks were removed in a previous grunt useref execution.

Would be nice to have Grunt task option (optional) that flags the task to keep build block comments.