forked from Orange-OpenSource/angular-swagger-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
43 lines (35 loc) · 1.15 KB
/
Gruntfile.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
39
40
41
42
43
module.exports = function(grunt) {
'use strict';
var matchdep = require('matchdep'),
config = {
pkg: grunt.file.readJSON('package.json')
};
/**
* @description
* Concatenate all .js files in path to a single object.
*
* Original source: http://www.thomasboyt.com/2013/09/01/maintainable-grunt.html
*
* @param {string} path Base path to the config files
* @returns {object}
*/
function loadTaskOptions(path) {
var glob = require('glob'),
taskOptions = {},
key;
glob.sync('*', {
cwd: path
}).forEach(function(option) {
key = option.replace(/\.js$/, '');
taskOptions[key] = require(path + option);
});
return taskOptions;
}
// Extend config with task options definitions
grunt.util._.extend(config, loadTaskOptions('./build-conf/options/'));
grunt.initConfig(config);
// Load all tasks from the dependencies in package.json
matchdep.filterDev('grunt-*').forEach(grunt.loadNpmTasks);
// Load custom tasks from ./grunt/*.js
grunt.loadTasks('build-conf/');
};