-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
145 lines (140 loc) · 4.67 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/*global module:false, require:false*/
module.exports = function (grunt) {
var assetsRoot = 'templates/assets';
var staticRoot = 'static';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options: {
jshintrc: '.jshintrc'
},
gruntfile: {
src: 'Gruntfile.js'
},
main: {
src: assetsRoot + '/js/*.js'
},
test: {
src: 'test/*.js'
}
},
csslint: {
main: {
options: {
csslintrc: '.csslintrc',
excludeList: 'elusive-webfont.css'
},
src: [assetsRoot + '/css/*.css']
}
},
cssmin: {
main: {
options: {
banner: '/* HSS CSS - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */ ',
report: 'gzip'
},
files: {
'gen/css/3cs-all.css': [assetsRoot + '/css/*.css']
}
}
},
clean: ['gen'],
staticHandlebars: {
main: {
options: {
assets: {
partialPath: 'templates/html/partials/*.html'
}
},
files: [
{'gen/*.html': 'templates/html/*.html'},
{'gen/about/*.html': 'templates/html/about/*.html'},
{'gen/automateddeployment/*.html': 'templates/html/automateddeployment/*.html'},
{'gen/consulting/*.html': 'templates/html/consulting/*.html'},
{'gen/contact/*.html': 'templates/html/contact/*.html'},
{'gen/continuousintegration/*.html': 'templates/html/continuousintegration/*.html'},
{'gen/devops/*.html': 'templates/html/devops/*.html'},
{'gen/engineering/*.html': 'templates/html/engineering/*.html'},
{'gen/metrics/*.html': 'templates/html/metrics/*.html'},
{'gen/partners/*.html': 'templates/html/partners/*.html'},
{'gen/products/*.html': 'templates/html/products/*.html'},
{'gen/solutions/*.html': 'templates/html/solutions/*.html'},
{'gen/tools/*.html': 'templates/html/tools/*.html'},
{'gen/values/*.html': 'templates/html/values/*.html'}
]
}
},
watch: {
options: {
livereload: true
},
default: {
files: [assetsRoot + '/**/*.*', 'templates/html/**/*.*', 'templates/js/**/*.*', 'test/**/*.*'],
tasks: ['build']
}
},
connect: {
server: {
options: {
hostname: '*',
port: 8000,
base: 'gen'
}
}
},
copy: {
main: {
files: [
{
expand: true,
flatten: true,
src: [staticRoot + '/css/**/*.*'],
dest: 'gen/css',
filter: 'isFile'
},
{
expand: true,
flatten: true,
src: [assetsRoot + '/images/**/*.*'],
dest: 'gen/images',
filter: 'isFile'
},
{
expand: true,
flatten: true,
src: [assetsRoot + '/js/*.js'],
dest: 'gen/js',
filter: 'isFile'
},
{
expand: true,
flatten: true,
src: [assetsRoot + '/js/lib/*.js'],
dest: 'gen/js/lib',
filter: 'isFile'
}
]
}
}
});
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.registerTask('default', [
'jshint:gruntfile',
'jshint:main',
'jshint:test',
'csslint:main',
'staticHandlebars',
'cssmin',
'copy'
]);
grunt.registerTask('build', [
'jshint:gruntfile',
'jshint:main',
'jshint:test',
'csslint:main',
'staticHandlebars',
'cssmin',
'copy'
]);
};