Grunt task to check for broken AMD dependencies
grunt-amd-check is a grunt multitask to check for broken AMD dependencies in a project.
This plugin requires Grunt
From the same directory as your Gruntfile, run
npm install grunt-amd-check
Then add the following line to your Gruntfile:
You can verify that the task is available by running
grunt --help and
checking that "amd-check" is under "Available tasks".
grunt-amd-check reads two sections of your config:
amd-check can contain these properties (example from
'amd-check'://Grunt files configuration object for which to trace dependencies//(more: )files: 'src/**/*.js' 'test/spec/**/*.js'
requirejs is a standard r.js configuration
packages (all optional)
to transform AMD module names to absolute file names. If the
property is given, the configuration in that file will be mixed-in to the
requirejs property with a lower precedence (that is, in the case of a
conflicting configuration property,
requirejs will always "win" against
grunt amd-check iterates through all files matched in the
files option and
reports any dependencies which cannot be resolved to absolute paths.
grunt whatrequires accepts a single argument
searchFile and iterates
through all files matched in the
files option, looking for modules which list
searchFile as a dependency (in any valid RequireJS format). Note: Grunt
denotes arguments using a ":" character after the task name, followed by the
grunt whatrequires:src/js/BaseController.js might report
src/js/NavigationController.js as dependents.
Released under the MIT License.