grunt-fingerprint

0.2.1 • Public • Published

Assets versioning task for Grunt

Powered by You Build Status

Installation

This plugin requires Grunt 0.4.

Install grunt-fingerprint:

npm install grunt-fingerprint --save-dev

Add somewhere in your Gruntfile.js:

grunt.loadNpmTasks('grunt-fingerprint');

Inside your Gruntfile.js file add a section named fingerprint. See Parameters section below for details.

Parameters

All parameters supports grunt.template.

src String|Array

Array of your static files (or string for single file). Newest file will be used to calculate fingerprint. Wildcards are supported.

filename String

Name of file where fingerprint will be saved. You can use target context variable here:

filename: '<%= target %>.txt'

template String

Fingerprint file contents template. You can use fingerprint context variable here:

template: "<?php define('FINGERPRINT', '<%= fingerprint %>'); ?>"

If template not specified only fingerprint will be written to file.

Config Example

fingerprint: {
  assets: {
    src: [
      'js/*.js',
      'css/*.css'
    ],
    filename: 'fingerprint.php',
    template: "<?php define('FINGERPRINT', '<%= fingerprint %>'); ?>"
  }
}

Changelog

The changelog can be found in the Changelog.md file.


License

The MIT License, see the included License.md file.

Package Sidebar

Install

npm i grunt-fingerprint

Weekly Downloads

28

Version

0.2.1

License

MIT

Last publish

Collaborators

  • sapegin