Skip to content

Grunt task for fixing md5s to files in html head. for cache busting.

License

Notifications You must be signed in to change notification settings

heimojuh/grunt-mdfiver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

grunt-mdfiver

Calculates md5's for cache busting. Pretty automatic, give tags you want to bust as an array (attr is the attribute containing file path). Suffix is mainly for stuff like require.js modules. The suffix is appended when renaming, and removed when injecting bust-string.

Note that this will overwrite the htmlfile, as well as rename the assets it finds, so you better use some place safe.

Getting Started

Install this grunt plugin next to your project's grunt.js gruntfile

Documentation

grunt.initConfig({
    mdfiver: {
        all: {
            htmlfile: "build-dir/index.html",
            basepath: "build-dir/",
            tags: [{tag:"script", attr:"src"}, {tag:"link", attr:"href"}, {tag:"script", attr:"data-main", suffix: ".js"}]
        }
    }
... 

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)

License

Copyright (c) 2012 Juha Heimonen
Licensed under the MIT license.

About

Grunt task for fixing md5s to files in html head. for cache busting.

Resources

License

Stars

Watchers

Forks

Packages