-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
executable file
·58 lines (46 loc) · 1.23 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
47
48
49
50
51
52
53
54
55
56
57
58
module.exports = function(grunt) {
// Initialize config.
grunt.initConfig({
wd: global.namelesscwd,
pkg: grunt.file.readJSON('./package.json'),
buildTasks: [],
clean: {
temp: [ '.tmp/' ]
},
// Generic messages
notify: {
watch: {
options: {
message: 'Watch assets updated.'
}
}
}
});
if (!global.configutil.loadConfig(grunt))
return;
// Verify the config
global.configutil.verifyConfig(grunt);
// Hijack the logger
global.loghook(grunt);
// Load all tasks through our task loader
global.taskloader(grunt);
// Load some npm tasks
grunt.task.loadNpmTasks('grunt-contrib-clean');
// Use parallel build?
var useParallel = grunt.config('config.parallel');
if (useParallel === true) {
var concurrent = require('./util/concurrent');
concurrent(grunt, grunt.config('buildTasks'));
}
else {
grunt.registerTask('buildTasks', grunt.config('buildTasks'));
}
// Register our build and watch tasks
grunt.registerTask('build', ['clean:temp', 'buildTasks', 'task-watch']);
grunt.registerTask('default', ['build', 'task-waitexit']);
grunt.registerTask('config', function () {
console.log(grunt.config.get());
});
//Restore the cwd to the calling folder
process.chdir(grunt.config('wd'));
};