is there a way to pass in an array to grunt.js from the package.json file? I\'ve tried a few different ways and none of them seem to work. I currently have:
Since gruntjs in run in node you can access the package.json like:
var package = require('./package.json'),
property = package.property[0];
grunt.initConfig({
lint: grunt.file.readJSON('package.json').lint,
});
I think that the <%= … %>
syntax (variable interpolation in Underscore's template system) can only output strings, not arrays/objects.
Try this instead:
lint: {
files: '<config:pkg.lint>'
}
I found this syntax in Grunt's jQuery init task.