Repository navigation
Expand file tree
/
Copy pathGruntfile.js
More file actions
180 lines (162 loc) · 3.8 KB
/
Copy pathGruntfile.js
File metadata and controls
180 lines (162 loc) · 3.8 KB
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
module.exports = function(grunt) {
// dynamically load grunt plugins
require('jit-grunt')(grunt, {
'bump-only': 'grunt-bump',
'bump-commit': 'grunt-bump'
});
// project configuration
grunt.initConfig({
// read package info
pkg: grunt.file.readJSON('package.json'),
// paths
srcPath: 'src/demo',
buildPath: 'demo',
sassSrcPath: 'src/demo/styles',
cssBuildPath: 'demo/styles',
sassboxPath: 'src/sassbox/modules',
sassdocPath: 'docs',
sassboxFile: '_sassbox.scss',
// watch: plugin config
watch: {
jade: {
files: ['<%= srcPath %>/{,*/}*.jade'],
tasks: ['jade']
},
sass: {
files: ['<%= sassSrcPath %>/{,*/}*.scss'],
tasks: ['sass']
},
sassdoc: {
files: ['<%= sassboxPath %>/{,*/}*.scss'],
tasks: ['sassdoc']
}
},
// clean: plugin config
clean: {
demo: {
src: [
'<%= buildPath %>'
]
},
docs: {
src: [
'<%= sassdocPath %>'
]
},
dist: {
src: [
'<%= sassboxFile %>'
]
}
},
// copy: plugin configuration
copy: {
demo: {
files: [{
expand: true,
dot: true,
cwd: '<%= srcPath %>',
dest: '<%= buildPath %>',
src: [
'images/{,*/}*.{gif,jpg,png,svg,webp}'
]
}]
}
},
// jade: plugin config
jade: {
base: {
options: {
pretty: true,
},
files: [
{
expand: true,
cwd: '<%= srcPath %>',
src: '{,*/}*.jade',
dest: '<%= buildPath %>',
ext: '.html'
}
]
}
},
// sass: plugin config
sass: {
options: {
precision: 10
},
dist: {
expand: true,
cwd: '<%= sassSrcPath %>',
src: ['{,*/}*.scss'],
dest: '<%= cssBuildPath %>',
ext: '.css'
}
},
// concat: plugin config
concat: {
sassbox: {
options: {
banner: '// <%= pkg.name %> <%= pkg.version %> \n' +
'// <%= pkg.repository.url %>\n' +
'// (c) 2015 - <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> <<%= pkg.author.url %>>\n' +
'// <%= pkg.license %>\n' +
'// <%= grunt.template.today("dd.mm.yyyy HH:MM") %>\n\n'
},
src: ['<%= sassboxPath %>/{,*/}_*.scss'],
dest: '<%= sassboxFile %>'
}
},
// sassdoc: plugin config
sassdoc: {
default: {
options: {
dest: '<%= sassdocPath %>',
theme: 'default'
},
src: '<%= sassboxPath %>'
}
},
// bump version: plugin config
bump: {
options: {
files: ['package.json'],
updateConfigs: [],
commit: true,
commitMessage: 'Release v%VERSION%',
commitFiles: ['package.json'],
createTag: true,
tagName: 'v%VERSION%',
tagMessage: 'Version %VERSION%',
push: true,
pushTo: 'upstream',
gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d',
globalReplace: false,
prereleaseName: false,
regExp: false
}
}
});
// register tasks
grunt.registerTask('default', 'clean-build of dist, docs and demo project', [
'clean',
'copy',
'concat:sassbox',
'jade',
'sass',
'sassdoc'
]);
grunt.registerTask('dist', 'build the dist file', [
'concat:sassbox'
]);
grunt.registerTask('docs', 'build the docs (alias for task sassdoc)', [
'clean:docs',
'sassdoc'
]);
grunt.registerTask('demo', 'build the demo project', [
'clean:demo',
'copy',
'jade',
'sass'
]);
};