grunt-md5vel
Grunt plugin for generating MD5
filenames.
Getting Started
Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-md5vel
Then add this line to your project's grunt.js
gruntfile:
grunt.loadNpmTasks('grunt-md5vel');
Then specify what files you want to generate an md5 filename in your config:
grunt.initConfig({
md5vel: {
compile: {
files: [{
'dest/folder/': 'src/file'
}],
options: {
prefix: '',
hash: function(hash){
return hash.substr(0,8)
},
suffix: '',
extension: 'ext' || {
'js': 'my.js',
'css': 'our.css'
}
template: _.template(
"<%= _.filter([prefix, hash, suffix]).join(delimiter) %>" +
"<%= extension? '.':'' %><%= extension %>")
beforeEach: function (filename, options){}
afterEach: function (fileChange) {},
after: function (fileChanges) {}
}
}
}
});