|
|
@ -15,6 +15,9 @@ var fileinclude = require("gulp-file-include");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var babel = require('gulp-babel');
|
|
|
|
var babel = require('gulp-babel');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const imagemin = require('gulp-imagemin');
|
|
|
|
|
|
|
|
// npm install gulp-imagemin @6.1.0
|
|
|
|
// 创建
|
|
|
|
// 创建
|
|
|
|
gulp.task("connect", function () {
|
|
|
|
gulp.task("connect", function () {
|
|
|
|
connect.server({
|
|
|
|
connect.server({
|
|
|
@ -99,7 +102,8 @@ gulp.task('script', () => {
|
|
|
|
|
|
|
|
|
|
|
|
gulp.task("img", function () {
|
|
|
|
gulp.task("img", function () {
|
|
|
|
return gulp
|
|
|
|
return gulp
|
|
|
|
.src("src/static/img/*")
|
|
|
|
.src('src/static/img/*.{jpg,png}')
|
|
|
|
|
|
|
|
.pipe(imagemin())
|
|
|
|
.pipe(gulp.dest("dist/static/img/"))
|
|
|
|
.pipe(gulp.dest("dist/static/img/"))
|
|
|
|
.pipe(connect.reload()); //更新;
|
|
|
|
.pipe(connect.reload()); //更新;
|
|
|
|
});
|
|
|
|
});
|
|
|
|