-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
35 lines (33 loc) · 968 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
'use strict';
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
cssmin = require('gulp-minify-css'),
imagemin = require('gulp-imagemin');
//JS压缩
gulp.task('uglify', function() {
return gulp.src('././public/js/*.js')
.pipe(uglify())
.pipe(gulp.dest('././public/js/'));
});
//CSS压缩
gulp.task('cssmin', function() {
return gulp.src('././public/css/navy.css')
.pipe(cssmin())
.pipe(gulp.dest('././public/css/'));
});
//CSS压缩
gulp.task('vendorcss', function() {
return gulp.src('././public/vendors/*.css')
.pipe(cssmin())
.pipe(gulp.dest('././public/vendors/'));
});
//图片压缩
gulp.task('images', function() {
gulp.src('././public/css/img/**/*.*')
.pipe(imagemin({
progressive: false
}))
.pipe(gulp.dest('././public/css/img/'));
});
gulp.task('build', ['uglify', 'vendorcss', 'cssmin', 'images']);