forked from randyamiel/css
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
117 lines (103 loc) · 3.49 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
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
// **************************************************************************
//
// Gulpfile
//
// **************************************************************************
// -------------------------------------
// Load gulp, config, & plugins
// -------------------------------------
const gulp = require('gulp');
const gconfig = require('./gulp/gulp-config.js');
const runSequence = require('run-sequence');
// -------------------------------------
// PostCSS Plugins
// -------------------------------------
// postcss-for : Allow at-for loops
// postcss-variables : Allow at-vars in at-for loops
// postcss-import : Include css files with '@'
// postcss-commas : Allow lists of properties per value
// postcss-cssnext : Collection of future proof plugins
// postcss-mixins : Use mixins
// cssnano : CSS minify
// lost : Grid system
// -------------------------------------
const postCssPlugins = {
atFor : require('postcss-for'),
atImport : require('postcss-import'),
atVariables: require('postcss-at-rules-variables'),
commas : require('postcss-commas'),
cssnext : require('postcss-cssnext'),
cssnano : require('cssnano'),
mixins : require('postcss-mixins'),
lost : require('lost')
};
// -------------------------------------
// Global Variables
// -------------------------------------
let arrOfIcons = [];
// -------------------------------------
// Load Tasks
// -------------------------------------
require(`${gconfig.paths.tasks}/accessibility.js`)(gulp, gconfig);
require(`${gconfig.paths.tasks}/build.js`)(gulp, gconfig);
require(`${gconfig.paths.tasks}/clean.js`)(gulp, gconfig);
require(`${gconfig.paths.tasks}/demo-css-compile.js`)(gulp, gconfig);
require(`${gconfig.paths.tasks}/deploy.js`)(gulp, gconfig);
require(`${gconfig.paths.tasks}/json-md-compile.js`)(gulp, gconfig);
require(`${gconfig.paths.tasks}/json-yaml-compile.js`)(gulp, gconfig);
require(`${gconfig.paths.tasks}/serve.js`)(gulp, gconfig);
require(`${gconfig.paths.tasks}/site-css-compile.js`)(gulp, gconfig);
require(`${gconfig.paths.tasks}/site-css-lint.js`)(gulp, gconfig);
require(`${gconfig.paths.tasks}/src-css-compile.js`)(gulp, gconfig, postCssPlugins);
require(`${gconfig.paths.tasks}/src-css-lint.js`)(gulp, gconfig);
require(`${gconfig.paths.tasks}/src-md-compile.js`)(gulp, gconfig);
require(`${gconfig.paths.tasks}/svg-store.js`)(gulp, gconfig);
// -------------------------------------
// Common Tasks
// -------------------------------------
// gulp default
// gulp dev
// gulp publish
//
// npm test (package json)
// -------------------------------------
gulp.task('default', done => {
runSequence(
'clean',
'css:lint',
'svg:store',
'src:compile',
['site:compile', 'demo:css:compile'],
done);
});
gulp.task('dev', done => {
runSequence(
'clean',
'svg:store',
'src:compile',
'site:compile',
'demo:css:compile',
'serve',
done
);
});
gulp.task('publish', done => {
runSequence(
'clean',
'src:css:lint',
'svg:store',
'demo:compile',
'build',
'deploy',
'clean:publish',
done
);
});
// -------------------------------------
// Build Task Combos
// -------------------------------------
gulp.task('clean', ['clean:publish', 'clean:src', 'clean:site']);
gulp.task('css:lint', ['src:css:lint', 'site:css:lint']);
gulp.task('src:compile', ['src:css:compile']);
gulp.task('site:compile', ['site:css:compile', 'src:md:compile']);
gulp.task('demo:compile', ['demo:css:compile']);