From e36c8c2d4ac90e320677c5ce16f00dafeea41281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BD=AD=E7=BF=A9?= Date: Wed, 13 Mar 2024 16:50:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=9D=E8=AF=95=E5=8E=8B=E7=BC=A9img?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulpfile.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 34ae6a3..ca2bd84 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -15,6 +15,9 @@ var fileinclude = require("gulp-file-include"); var babel = require('gulp-babel'); + +const imagemin = require('gulp-imagemin'); +// npm install gulp-imagemin @6.1.0 // 创建 gulp.task("connect", function () { connect.server({ @@ -99,7 +102,8 @@ gulp.task('script', () => { gulp.task("img", function () { return gulp - .src("src/static/img/*") + .src('src/static/img/*.{jpg,png}') + .pipe(imagemin()) .pipe(gulp.dest("dist/static/img/")) .pipe(connect.reload()); //更新; });