UNPKG

575 BJavaScriptView Raw
1var Lumbar = require('../lib/lumbar');
2
3module.exports = function(grunt) {
4 grunt.registerMultiTask('module-map', 'outputs a projects module map', function() {
5 var done = this.async();
6
7 var config = this.options({config: './lumbar.json'}),
8 lumbarFile = config.config,
9 outputFile = config.dest;
10
11 var lumbar = Lumbar.init(lumbarFile, config);
12 lumbar.moduleMap(config.package, function(err, map) {
13 if (err) {
14 throw err;
15 }
16
17 grunt.file.write(outputFile, JSON.stringify(map, undefined, 2));
18 done();
19 });
20 });
21};