1.0.0 • Published 10 years ago
grunt-versioning v1.0.0
#File versioning tool
####How to use it in code?
// insert ##VERSION: in front of the css or js files import, not that you should use double
// quote rather than single quote
<link href="##VERSION:/css/main.css" rel="stylesheet" >
grunt.loadNpmTasks("grunt-versioning");
grunt.config("versioning", {
options: {
//base directory for dust & plugin
base: ".build",
//base directory for js and css
assetBase: ".build/static",
//generate versioning comparation file
debug: true //default value is false
},
dust: {
src: ["templates/skins/**/*.dust", "templates/skins/**/*.html"]
},
plugin: {
src: ["static/plugin/**/*.html"]
}
});
####Environment related stuff If you register the task name as "build" , it will generate versioned files and patch versioning numbers to files
//prod or production or staging, any name you like
grunt.registerTask('prod', ['clean', 'jshint', 'copy', 'browserify', 'versioning']);
Else, versioning tool will remove the ##VERSIONING tag
// dev or development or watch
grunt.registerTask('dev', ['clean', 'jshint', 'copy', 'browserify', 'versioning']);