Skip to content

generates md5 hash code based on the content of the file. append this hash to the filename.

License

Notifications You must be signed in to change notification settings

migme/grunt-fingerprint-assets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-asset-fingerprint

Build Status

Overview

This plugin is originated from here. Bryan Huang (I specify the name of the person to blame.) modified it to serve the purposes of both browser caching javascript files and free up CDN space. We plan to use filename{hash_code} for version controlling instead of copying everything to CDN after every jenkin jobs that jacks up spaces in CDN. We only replace the hash code that is different from the previous version.

What does it do

generate a hashMap js script which exports a filepath: {hash_code} map:

{
  "hotkey_emoticon_map.js": ".1a849810b01e81a43fedd7b6e4d7a81",
  "main.js": "0c9eaf8c88f5045b2db989bc54ef44c2",
  "mig33_backbone.js": "f7be238c619ca5e4d15b8a7b01ce48c7",
  ...
}

Config

assetFingerprint: {
  "options": {
    "manifestPath": "dist/hashMap.js" // generates hashMap.js to dist folder.
    "manifestNoPath": true // only keep the hash part of the filename
  },
  "dist": {
    "files": [
      {
        "expand": true,
        "cwd": "app/scripts",
        "src": ['**/*.js']
      }
    ]
  }
}

Running Specs

no tests are written at the moment.

About

generates md5 hash code based on the content of the file. append this hash to the filename.

Resources

License

Stars

Watchers

Forks

Packages

No packages published