-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
38 lines (32 loc) · 869 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
var gulp = require('gulp')
var uglify = require('gulp-uglify')
var cleanCSS = require('gulp-clean-css')
var htmlmin = require('gulp-htmlmin')
var paths = {
js: ['./src/**/*.js'],
html: ['./src/**/*.html'],
css: ['./src/**/*.css']
}
gulp.task('default', ['js', 'html', 'css'], function () {
return true
})
gulp.task('js', function () {
return gulp.src(paths.js)
.pipe(uglify())
.pipe(gulp.dest('./dist'))
})
gulp.task('html', function () {
return gulp.src(paths.html)
.pipe(htmlmin({collapseWhitespace: true}))
.pipe(gulp.dest('./dist'))
})
gulp.task('css', function () {
return gulp.src(paths.css)
.pipe(cleanCSS({compatibility: 'ie8'}))
.pipe(gulp.dest('./dist'))
})
gulp.task('watch', ['js', 'html', 'css'], function () {
gulp.watch(paths.js, ['js'])
gulp.watch(paths.html, ['html'])
gulp.watch(paths.css, ['css'])
})