forked from Pier1/rocketbelt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
71 lines (63 loc) · 2.2 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
'use strict';
var gulp = require('gulp');
var plugins = require('gulp-load-plugins')({ DEBUG: false, pattern: '*' });
var buildPath = './dist';
var buildCssPath = buildPath + '/css';
var patternsPath = './rocketbelt';
var templatesPath = './templates';
var tasksPath = './gulp-tasks';
var utilsPath = tasksPath + '/utils';
var config = {
buildPath: buildPath,
buildCssPath: buildCssPath,
colorFamilies: require(templatesPath + '/base/color/_color-families.json'),
patternsPath: patternsPath,
templatesPath: templatesPath,
sizeOptions: {
showFiles: true,
gzip: true
}
};
var utils = {
getTask: require(utilsPath + '/getTask')
};
function getTask(task, taskParams) {
return require('./gulp-tasks/' + task)(gulp, plugins, config, taskParams);
}
gulp.task('default', getTask('default'));
gulp.task('a11y', getTask('a11y'));
gulp.task('build', getTask('build'));
gulp.task('clean-links', getTask('clean-links'));
gulp.task('clean', ['clean-links'], getTask('clean'));
gulp.task('copy-js', getTask('copy-js'));
gulp.task('copy-resources', getTask('copy-resources'));
gulp.task('css-sort', getTask('css-sort'));
gulp.task('feature-detection', getTask('feature-detection'));
gulp.task('icons-enterprise', getTask('icons', { enterprise: true }));
gulp.task('icons-ecom', getTask('icons'));
gulp.task('icons', ['icons-ecom', 'icons-enterprise']);
gulp.task('link-svg', getTask('link-svg'));
gulp.task('link-templates', getTask('link-templates'));
gulp.task('link-js', getTask('link-js'));
gulp.task('link', ['link-templates', 'link-js', 'link-svg']);
gulp.task('lint-sass', ['css-sort'], getTask('lint-sass'));
gulp.task('server', getTask('server'));
gulp.task('sitemap', getTask('sitemap'));
gulp.task('styles', getTask('styles'));
gulp.task('test-webserver', getTask('test-webserver'));
gulp.task('test-visual', ['test-webserver'], getTask('test-visual'));
gulp.task('uglify', getTask('uglify'));
gulp.task('views', ['copy-js', 'copy-resources'], getTask('views'));
gulp.task('watch', getTask('watch'));
function throttle (callback, limit) {
var wait = false;
return function () {
if (!wait) {
callback.call();
wait = true;
setTimeout(function () {
wait = false;
}, limit);
}
};
}