-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathgulpfile.js
59 lines (46 loc) · 1.5 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
'use strict';
var gulp = require('gulp');
var concatCss = require('gulp-concat-css');
var cleanCSS = require('gulp-clean-css');
var exec = require('gulp-exec');
/* Minify all base code, edit in place */
gulp.task('minify_base_code', function() {
return gulp.src(['css/common-files/*.css', 'css/userContent-files/*.css', 'css/userChrome-files/*'])
.pipe(cleanCSS({
level : 2 ,
format: 'beautify'
}))
.pipe(gulp.dest(function(file) {
return file.base;
}));
});
/* Add everything to userContent */
gulp.task('userContent', function() {
return gulp.src(['css/common-files/*.css', 'css/userContent-files/*.css'])
.pipe(concatCss('userContent.css'))
.pipe(gulp.dest('.'));
});
/* Add everything to userChrome */
gulp.task('userChrome', function() {
return gulp.src(['css/common-files/*.css', 'css/userChrome-files/!(patch_windows)*.css', 'css/userChrome-files/*.css'])
.pipe(concatCss('userChrome.css'))
.pipe(gulp.dest('.'));
});
/* Minify final user files */
gulp.task('minify_final', function() {
return gulp.src(['userChrome.css', 'userContent.css'])
.pipe(cleanCSS({
level : 2 ,
format: 'beautify'
}))
.pipe(gulp.dest(function(file) {
return file.base;
}));
});
/* Publish */
gulp.task('publish', gulp.series('minify_base_code', 'userChrome', 'userContent', 'minify_final'));
/* Gulp Push - used to push to GitHub and re-add internal UUIDs */
gulp.task('push', function() {
return gulp.src('.')
.pipe(exec('git push'))
});