-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
46 lines (43 loc) · 1.1 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
39
40
41
42
43
44
45
46
var gulp = require('gulp'),
nodemon = require('gulp-nodemon'),
uglify = require('gulp-uglify'),
imagemin = require('gulp-imagemin'),
csso = require('gulp-csso'),
htmlmin = require('gulp-htmlmin');
gulp.task('start', ['minify'], function() {
nodemon({
script: 'http.js',
}).on('start');
});
gulp.task('minify', function() {
gulp.src('dev/html/*.html')
.pipe(htmlmin({collapseWhitespace: true}))
.pipe(gulp.dest('public/html/'));
gulp.src('dev/css/*.css')
.pipe(csso())
.pipe(gulp.dest('public/css/'));
gulp.src('dev/images/home/*')
.pipe(imagemin({
multipass: true,
svgoPlugins: [{removeViewBox: false}]
}))
.pipe(gulp.dest('public/images/home/'));
gulp.src('dev/images/board/*')
.pipe(imagemin({
multipass: true,
svgoPlugins: [{removeViewBox: false}]
}))
.pipe(gulp.dest('public/images/board/'));
gulp.src('dev/js/*.js')
.pipe(uglify({
compress: {
drop_console: true
}
}))
.pipe(gulp.dest('public/js/'));
});
gulp.task('default', ['minify'], function() {
nodemon({
script: 'http.js',
}).on('start');
});