-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
36 lines (27 loc) · 957 Bytes
/
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
/*jslint node: true */
'use strict';
module.exports = function (grunt) {
var
dependency,
config = require('./grunt/config')(grunt);
config.pkg = config.pkg || grunt.file.readJSON('package.json');
// Initialise grunt "before" other config
grunt.initConfig(config);
// Read config files from the `grunt/config/` folder
grunt.file.expand('grunt/config/*.js').forEach(function (path) {
var
property = /grunt\/config\/(.+)\.js/.exec(path)[1],
module = require('./' + path);
config[property] = 'function' === typeof module ? module(grunt) : module;
});
// Load development dependencies specified in package.json
for (dependency in config.pkg.devDependencies) {
if (config.pkg.devDependencies.hasOwnProperty(dependency)) {
if (/^grunt-/.test(dependency)) {
grunt.loadNpmTasks(dependency);
}
}
}
// Load tasks from the `grunt-tasks/` folder
grunt.loadTasks('grunt/tasks');
};