From 14581309b467aeab92e1a866d626e7c6b1f3ab08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Tue, 7 Nov 2023 23:04:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20sourcemaps=20=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulpfile.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 7cbccc85..d521bfcb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -56,7 +56,7 @@ const js = () => { })) .pipe(concat('layui.js', {newLine: ''})) .pipe(header.apply(null, config.comment)) - .pipe(sourcemaps.write('')) + .pipe(sourcemaps.write('.')) .pipe(gulp.dest(dest)); }; @@ -71,10 +71,10 @@ const css = () => { compatibility: 'ie8' })) .pipe(concat('layui.css', {newLine: ''})) - .pipe(sourcemaps.write('')) + .pipe(sourcemaps.write('.')) .pipe(gulp.dest(dest +'/css')); }; - + // files const files = () => { let src = ['./src/**/*.{eot,svg,ttf,woff,woff2,html,json,png,jpg,gif}']; @@ -99,7 +99,7 @@ const cp = () => { .pipe(replace(/\n\/(\*|\/)\#[\s\S]+$/, '')) // 过滤 css 和 js 的 map 特定注释 .pipe(gulp.dest(dest)); }; - + // release const rls = () => { return gulp.src('./release/doc/**/*') @@ -129,7 +129,7 @@ exports.rls = gulp.series(cleanRLS, rls); // release task // layer task exports.layer = () => { // gulp layer let dest = './release/layer'; - + gulp.src('./src/css/modules/layer.css') .pipe(gulp.dest(dest + '/src')); @@ -144,11 +144,11 @@ exports.laydate = () => { // gulp laydate '\n/** \n * <%= title %> \n * <%= license %> Licensed \n */ \n\n' ,{title: 'laydate 日期与时间组件(单独版)', license: 'MIT'} ]; - + // css gulp.src('./src/css/modules/laydate.css') .pipe(gulp.dest(dest + 'src')); - + // js return gulp.src(['./src/layui.js', './src/modules/{lay,laydate}.js']) .pipe(replace('win.layui =', 'var layui =')) // 将 layui 替换为局部变量 @@ -174,7 +174,7 @@ exports.help = () => { desc: '生成一个带版本号的文件夹' } }); - + parser.showHelp(console.log); console.log([ 'Tasks:',