-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
70 lines (47 loc) · 1022 Bytes
/
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
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var pump = require('pump');
var cleanCSS = require('gulp-clean-css');
/**
CONFIG VARS
*/
var DIR_DIST = "html/dist";
var DIR_JS = "html/js",
DIR_CSS = "html/css",
DIR_LIBS = "html/libs";
gulp.task('compress-js', function (cb) {
pump([
gulp.src(DIR_JS+'/*.js'),
uglify({
preserveComments: "license"
}),
concat('site.min.js'),
gulp.dest(DIR_DIST)
],
cb
);
});
gulp.task('compress-libs', function (cb) {
pump([
gulp.src(DIR_LIBS+'/*.js'),
uglify({
preserveComments: "license"
}),
concat('libs.min.js'),
gulp.dest(DIR_DIST)
],
cb
);
});
gulp.task('minify-css', function (cb) {
pump([
gulp.src(DIR_CSS+'/*.css'),
cleanCSS({compatibility: 'ie8'}),
concat('style.min.css'),
gulp.dest(DIR_DIST)
],
cb
);
});
gulp.task('compress', ['compress-js', 'compress-libs', 'minify-css']);