-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
34 lines (30 loc) · 868 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
var gulp = require('gulp');
const htmlmin = require('gulp-htmlmin');
const image = require('gulp-image');
var cssmin = require('gulp-cssmin');
gulp.task('images', [], function () {
return gulp.src('./public-src/images/**/*')
.pipe(image({
pngquant: true,
optipng: true,
zopflipng: true,
jpegRecompress: true,
jpegoptim: true,
mozjpeg: true,
gifsicle: true,
svgo: true,
concurrent: 10
}))
.pipe(gulp.dest('./public/images/'));
});
gulp.task('html', [], function () {
return gulp.src('./public-src/views/**/*')
.pipe(htmlmin({collapseWhitespace: true}))
.pipe(gulp.dest('./public/views/'));
});
gulp.task('css', [], function () {
return gulp.src('./public-src/styles/**/*')
.pipe(cssmin())
.pipe(gulp.dest('./public/styles/'));
})
gulp.task('default', ['images', 'html','css']);