grunt-module-traversal

It's a tool for traverse all the dependencies of js modules, and write the imported css or js files to the html files!

grunt-module-traversal

It's a tool for dolphinjs to traverse the modules of one html file.

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-module-traversal --save-dev

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

grunt.loadNpmTasks('grunt-module-traversal');

You can run the testcase. change you path to ./node_modeules/grunt-module-traversal/, and run grunt. You could see the result file ./test/test_new.html 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: http://weibo.com/ginano

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

grunt.initConfig({
  moduleTraversal: {
    your_target: {
      // Target-specific file lists and/or options go here. 
    },
  },
})