-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
100 lines (81 loc) · 2.52 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Shell commands.
shell: {
jekyllServe: {
command: 'jekyll serve'
},
jekyllBuild: {
command: 'jekyll build'
},
gruntRecessApp: {
command: 'grunt recess:app'
},
gruntConcat: {
command: 'grunt concat'
}
},
// Watch task.
watch: {
files: [
'./source/*.html',
'./source/_includes/*.html',
'./source/_layouts/*.html',
'./source/_less/modules/*.less',
'./source/_less/*.less',
'./source/_js/*.js',
'./source/media/*',
'./source/index.html',
'./_config.yml',
],
tasks: ['shell:gruntConcat', 'shell:gruntRecessApp', 'shell:jekyllServe'],
options: {
interrupt: true,
atBegin: true
}
},
// Less lint and compile.
recess: {
options: {
compile: true,
compress: true
},
app: {
src: ['./source/_less/main.less'],
dest: './source/css/main.css'
}
},
build: {
tasks: ['shell:gruntConcat', 'shell:gruntRecessApp', 'shell:jekyllBuild'],
options: {
interrupt: true,
atBegin: true
}
},
// Concat for the JS files.
concat: {
dist: {
src: [
'./source/_js/console-errors.js',
'./source/_js/window-onload.js',
'./source/_js/document-ready.js',
'./source/_js/window-resize.js',
'./source/_js/widgets-config.js',
'./source/_js/google-maps.js'
],
dest: './source/js/main.js',
}
}
});
// NPM Dependencies.
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-contrib-concat');
// Tasks.
grunt.registerTask('default', ['shell']);
grunt.registerTask('app', ['recess:app']);
grunt.registerTask('build', ['shell:gruntConcat', 'shell:gruntRecessApp', 'shell:jekyllBuild']);
};