Create *.json for the static file asset and revisioning through content hashing.
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-static-revision --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-static-revision');
In your project's Gruntfile, add a section named static-revision
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
'static-revision': {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
});
Type: String
The project source directory
Type: String
The project dist directory
Type: String
Default value: static-revision.json
The configuration file name
Type: String
Default value: 0.0.0
Initialization version
Type: Array
Default value: [10, 100, 100]
Max version number
grunt.initConfig({
'static-revision': {
options: {
src: '<%= config.src %>',
dist: '<%= config.dist %>'
},
src: [
'<%= config.src %>/js/{,*/}*.js',
'<%= config.src %>/css/{,*/}*.css'
]
}
});
2014-07-25 optimizing log format
2014-07-24 concat config into one json file & bugfix
2014-07-21 first commit