-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
66 lines (52 loc) · 1.22 KB
/
gulpfile.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
/* jshint node: true, unused: true, undef: true */
var gulp = require('gulp');
// ----- setup ----- //
var data = {
productName: 'Huebee',
majorVersion: 1,
paletteColors: [
'#D28',
'#F00',
'#F80',
'#08F',
'#555',
'#FFF',
],
isDev: process.argv[2] == 'dev',
isExport: process.argv[2] == 'export',
};
data.sourceUrlPath = data.isExport ? '' : 'https://unpkg.com/huebee@1/dist/';
// files that will be watched, tasks that will be run
var watchables = [];
function watch( src, tasks ) {
watchables.push( [ src, tasks ] );
}
// ----- tasks ----- //
require('./tasks/assets')( data, watch );
require('./tasks/css')( data, watch );
require('./tasks/js')( data, watch );
require('./tasks/content')( data, watch );
require('./tasks/cache-bust')( data, watch );
require('./tasks/dist')( data, watch );
// ----- ----- //
gulp.task( 'default', [
'assets',
'dist',
'css',
'js',
'content',
]);
// ----- export ----- //
// version of site used in huebee-docs.zip
gulp.task( 'export', [
'dist',
'css',
'js',
'content',
]);
// ----- dev ----- //
gulp.task( 'dev', [ 'assets', 'content' ], function() {
watchables.forEach( function( watchable ) {
gulp.watch.apply( gulp, watchable );
});
});