-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
38 lines (32 loc) · 1.06 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
var gulp = require("gulp"),
cssNano = require("cssnano"),
del = require("del"),
postCSS = require("gulp-postcss"),
rename = require("gulp-rename"),
shell = require("gulp-shell"),
uglify = require("gulp-uglify"),
vinylPaths = require("vinyl-paths");
gulp.task("minify:css", function() {
var processors = [cssNano({ autoprefixer: false, discardUnused: false, zindex: false })];
return gulp.src("www/css/*.css")
.pipe(vinylPaths(del))
.pipe(postCSS(processors))
.pipe(rename({ suffix: ".min" }))
.pipe(gulp.dest("www/css"))
});
gulp.task("minify:js", function() {
return gulp.src(["www/js/*.js", "!www/js/jquery*.js"])
.pipe(vinylPaths(del))
.pipe(uglify())
.pipe(rename({ suffix: ".min" }))
.pipe(gulp.dest("www/js"))
});
gulp.task("minify", ["minify:css", "minify:js"]);
gulp.task("test", shell.task([
"harp server"
]));
gulp.task("build", shell.task([
"harp compile",
"gulp minify"
]));
gulp.task("default", ["build"]);