grunt-jquerytransform

Grunt task for transforming HTML files with jQuery

jQuery Transform

grunt-jquerytransform is a grunt task for transforming HTML files with jQuery, based on Mickael Daniel's original work in h5bp/node-build-script.

npm install grunt-jquerytransform

Version 0.0.2 was the last version of grunt-jquerytransform that was compatible with grunt 0.3. 0.1.0 and higher are for grunt 0.4.

grunt.initConfig({
  jquerytransform: {
    files: ['**/*.html'], // All HTML files
    transform: function($) {
      // For styling bullet separate from text
      $('.post li').wrapInner('<span />');
    }
  }
});
 
grunt.loadNpmTasks('grunt-jquerytransform');
 

If your transform depends on an asynchronous task you can call this.async() to get a callback to indicate the transform's completion.