/
index.js
38 lines (36 loc) · 959 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* @license
* grunt-template-progeny
* Copyright 2014 Luis Aleman <https://github.com/Lalem001/>
*/
(function (module) {
module.exports = function (grunt, config) {
var progeny = require('progeny').Sync(config);
/**
* Grunt Template Helper: Progeny
* Get the dependencies of the specified path in a glob ready list of paths
*
* @function "grunt.template.progeny"
* @param {string} path Source path or grunt template
* @returns {string} glob ready list of paths
* @example
* ```js
* {
* src: '<%= grunt.template.progeny("path/to/source.less") %>'
* }
* ```
* @example
* ```js
* {
* // using source path from another task
* src: '<%= grunt.template.progeny(less.main.src) %>'
* }
* ```
*/
grunt.template.progeny = function (path) {
path = grunt.template.process(path);
return '{' + [path].concat(progeny(path)) + ',}';
};
return grunt.template.progeny;
};
})(module);