grunt-asset-hasher
The Grunt plugin to make filename hashed and generate file list.
Getting Started
This plugin requires Grunt ~0.4.2
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-asset-hasher --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
The "asset_hasher" task
Overview
In your project's Gruntfile, add a section named asset_hasher
to the data object passed into grunt.initConfig()
.
grunt;
Options
options.prefix
Type: String
Default value: ``
A string value that is used to omit from file path in list file to be written
options.hash_key
Type: String
Default value: ``
A string value that is used to prefix key of hashing of file path
options.list
Type: Object
A object value that represents options of list file to be written
options.list.file
Type: 'StringDefault value:
assets.dat`
options.list.encrypt
Type: Object
Default value: null
A options of encrypting lsit file. It will not encrypt if this option does not exist
options.list.encrypt.algorithm
Type: string
,
Default value: aes128
An algorithm of encryption of list file
options.list.encrypt.secret
Type: string
,
Default value: secret
A secret key of encryption
Usage Examples
File name hasing and encrypting list file
grunt;
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Release History
(Nothing yet)