source: Dev/trunk/node_modules/grunt-amd-check/README.md

Last change on this file was 484, checked in by hendrikvanantwerpen, 11 years ago

Commit node_modules, to make checkouts and builds more deterministic.

File size: 2.2 KB
RevLine 
[484]1grunt-amd-check
2===============
3
4grunt-amd-check is a [grunt](http://gruntjs.com/) multitask to check for
5broken AMD dependencies in a project.
6
7This plugin requires Grunt `~0.4.0`
8
9
10Installation
11-------------
12
13From the same directory as your Gruntfile, run
14
15```
16npm install grunt-amd-check
17```
18
19Then add the following line to your Gruntfile:
20
21```js
22grunt.loadNpmTasks('grunt-amd-check');
23```
24
25You can verify that the task is available by running `grunt --help` and
26checking that "amd-check" is under "Available tasks".
27
28
29Configuration
30-------------
31
32grunt-amd-check reads two sections of your config: `amd-check` and
33`requirejs`. `amd-check` can contain these properties (example from
34[class.js](https://github.com/zship/class.js)):
35
36```js
37'amd-check': {
38        //Grunt files configuration object for which to trace dependencies
39        //(more: http://gruntjs.com/configuring-tasks)
40        files: ['src/**/*.js', 'test/spec/**/*.js']
41},
42```
43
44`requirejs` is a standard [r.js configuration
45object](https://github.com/jrburke/r.js/blob/master/build/example.build.js).
46grunt-amd-check uses `basePath`, `paths`, and `packages` (all optional)
47to transform AMD module names to absolute file names. If the `mainConfigFile`
48property is given, the configuration in that file will be mixed-in to the
49`requirejs` property with a **lower** precedence (that is, in the case of a
50conflicting configuration property, `requirejs` will always "win" against
51`mainConfigFile`).
52
53
54Tasks
55-----
56
57### amd-check
58
59`grunt amd-check` iterates through all files matched in the `files` option and
60reports any dependencies which cannot be resolved to absolute paths.
61
62### whatrequires
63
64`grunt whatrequires` accepts a single argument `searchFile` and iterates
65through all files matched in the `files` option, looking for modules which list
66`searchFile` as a dependency (in any valid RequireJS format). _Note: Grunt
67denotes arguments using a ":" character after the task name, followed by the
68argument._
69
70Example: `grunt whatrequires:src/js/BaseController.js` might report
71`src/js/HomeController.js` and `src/js/NavigationController.js` as dependents.
72
73
74License
75-------
76
77Released under the [MIT
78License](http://www.opensource.org/licenses/mit-license.php).
Note: See TracBrowser for help on using the repository browser.