-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
46 lines (34 loc) · 1.13 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
44
45
46
'use strict';
var _ = require("underscore");
var timer = require("grunt-timer");
function loadConfig(grunt, path) {
var glob = require('glob');
var object = {};
var key;
glob.sync('*', {cwd: path}).forEach(function(option) {
key = option.replace(/\.js$/,'');
object[key] = require(path + option)(grunt);
});
return object;
}
module.exports = function (grunt) {
// Project configuration.
require("load-grunt-tasks")(grunt);
// Enable task timer
timer.init(grunt, { friendlyTime: true });
// Load rest of tasks from ./grunt/tasks/*.js
grunt.loadTasks('grunt/tasks');
var getBanner = require("./grunt/helpers/bannerHelper")(grunt);
var pkg = grunt.file.readJSON('package.json');
var config = {
pkg: pkg,
name: "<% pkg.title || pkg.name %>",
banner: getBanner(),
paths: pkg.paths,
env: process.env,
};
// Load task config objects from ./grunt/options/*.js
grunt.util._.extend(config, loadConfig(grunt, './grunt/options/'));
grunt.initConfig(config);
grunt.registerTask('default', [ 'build:dev', 'test' ]);
};