Skip to content

Create *.json for the static file asset and revisioning through content hashing

License

Notifications You must be signed in to change notification settings

aNd1coder/grunt-static-revision

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-static-revision

Create *.json for the static file asset and revisioning through content hashing.

Getting Started

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');

The "static-revision" task

Overview

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.
    },
  },
});

Options

options.src

Type: String

The project source directory

options.dist

Type: String

The project dist directory

options.configFile

Type: String

Default value: static-revision.json

The configuration file name

options.initVersion

Type: String

Default value: 0.0.0

Initialization version

options.maxVersionNumber

Type: Array

Default value: [10, 100, 100]

Max version number

Usage Examples

grunt.initConfig({
    'static-revision': {
        options: {
            src: '<%= config.src %>',
            dist: '<%= config.dist %>'
        },
        src: [
            '<%= config.src %>/js/{,*/}*.js',
            '<%= config.src %>/css/{,*/}*.css'
        ]
    }
});

Release History

2014-07-25 optimizing log format

2014-07-24 concat config into one json file & bugfix

2014-07-21 first commit

About

Create *.json for the static file asset and revisioning through content hashing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published