From f2b71ad38943dce780118b91c31ba4c78667e404 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Wed, 25 Oct 2023 11:18:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20task=20=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulpfile.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index b61c248e..7cbccc85 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -63,8 +63,7 @@ const js = () => { // css const css = () => { let src = [ - './src/css/layui.css', - './src/css/modules/**/*.css', + './src/css/**/{layui,*}.css' ]; return gulp.src(src) .pipe(sourcemaps.init()) @@ -85,7 +84,19 @@ const files = () => { // cp const cp = () => { - return gulp.src('./dist/**/*') + const basePath = './dist/**/*'; + + // 复制 css js + gulp.src(`${basePath}.{css,js}`) + .pipe(replace(/\n\/(\*|\/)\#[\s\S]+$/, '')) // 过滤 css 和 js 的 map 特定注释 + .pipe(gulp.dest(dest)); + + // 复制其他文件 + return gulp.src([ + basePath, + `!${basePath}.{css,js,map}` // 过滤 map 文件 + ]) + .pipe(replace(/\n\/(\*|\/)\#[\s\S]+$/, '')) // 过滤 css 和 js 的 map 特定注释 .pipe(gulp.dest(dest)); };