forked from wzulfikar/github-asean-top-contributors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
24 lines (22 loc) · 784 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
var gulp = require('gulp'),
rename = require('gulp-rename'),
htmlmin = require('gulp-htmlmin'),
useref = require('gulp-useref'),
gulpIf = require('gulp-if'),
uglify = require('gulp-uglify'),
cleanCSS = require('gulp-clean-css'),
sequence = require('gulp-sequence');
gulp.task('build', function() {
return gulp.src("./_app.html")
.pipe(rename("index.html"))
.pipe(useref())
.pipe(gulpIf('*.js', uglify()))
.pipe(gulpIf('*.css', cleanCSS()))
.pipe(gulp.dest("./"));
});
gulp.task('compress', function() {
return gulp.src('index.html', {base: './'})
.pipe(htmlmin({ collapseWhitespace: true, removeComments: false, customAttrCollapse: /v-bind:class/ }))
.pipe(gulp.dest('./'));
});
gulp.task('default', sequence('build', 'compress'));