Scans through source code for "@requires" statements and produces a combined file which satisfies the dependencies
You may find this library useful for building custom versions of projects like OpenLayers for use in your own grunt project.
This plugin requires Grunt
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-combine-harvester --save-dev
In your project's Gruntfile, add a section named
combine_harvester to the data object passed into
The regex to be used by the default harvester function to find dependencies in scanned files
Default value: ``
A string value that is used to prefix the values of @requires statements, so that the resultant string can be used to locate the dependency relative to the cwd.
This must end in '/' if you want to use a directory as a root
The function which performs the harvesting of source code, to return a list of fully qualified dependencies to harvest.
In this example, a root is specified. So if the
dependency1 file has the content
@requires dependency3, the generated result would be the concatenation:
dependency3 + dependency1 + dependency2
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.