node package manager
It’s your turn. Help us improve JavaScript. Take the 2017 JavaScript Ecosystem Survey »



this tool will scan all the html files, and get all the images, css, js, html to generator the manifest file.

Getting Started

This plugin requires Grunt ~0.4.1

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-manifest-generator

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:


You can run the testcase. change you path to ./node_modeules/grunt-manifest-generator/, and run grunt. You could see the result file ./output/test.manifest file was created! The ./Gruntfile.js has the base function of this task, so you could use it as that. If you have any question, you can contact me at sina weibo: ## The "manifest-generator" task


In your project's Gruntfile, add a section named manifestGenerator to the data object passed into grunt.initConfig().

'use strict';
module.exports = function(grunt) {
    // Configuration to be run (and then tested). 
      test: {
          //is cache all the html files in source files 
          //is cache all the images tags or inline style with background-images in the  html files in source files 
          //is cache all the style files imported by the html 
          //is cache all the background-images in the css contents, which were used by the  html files 
          //is cache all the js files in the html files 
          //all the files above but the fllowwing files. 
          //{Array} the item could be writen as regexpress. 
        files: {
          //the task will scan all the source files, and generate 'test.manifest' file as the cache setting.  
          'test.manifest': ['test/test.html','test/index.html']
  // Actually load this plugin's task(s). 
  grunt.registerTask('grunt', ['manifestGenerator:test']);


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

2013-8-23 0.1.0 create the plugin

2013-10-12 0.1.1 add the extraFiles option for add some extra files to the manifest file. optimize the rule of geting image files from htmlcontent.

2013-11-25 0.1.2-0.1.3 add some comments for the sourecode. change the usage of lib/util.