grunt-resolve v0.1.2
resolve
Grunt task to resolve require tags in JavaScript files
The following file app.js requires the file controller.js to be prepended:
This is controller.js to be prepended to app.js.
In the Gruntfile.js we put now
This will create dist/app.js with the concatenated source code. resolve resolves files recursively, normalizes multiple dependencies from and to a given file, skips declared dependencies not found on disk and is robust concerning circular dependencies (does not loop).
Declaring dependencies
In a JavaScript file one or more require lines can be added:
All require lines of a file are gathered, hoisted to the top of the file and recursively resolved for transitive dependencies.
Multiple files can be listed separated by commas:
Dependencies are relative to the source file containing the require line:
Grunt task config
The complete configuration options are as follows: