优化 task 代码排版

pull/1292/head
贤心 2023-06-20 10:31:58 +08:00
parent 84e858e8e4
commit 6ebc87f9b9
1 changed files with 16 additions and 16 deletions

View File

@ -17,11 +17,11 @@ const yargs = require('yargs');
const config = { const config = {
// 注释 // 注释
comment: [ comment: [
'/** v<%= pkg.version %> | <%= pkg.license %> Licensed */<%= js %>' '/** v<%= pkg.version %> | <%= pkg.license %> Licensed */<%= js %>',
,{pkg: pkg, js: ';'} {pkg: pkg, js: ';'}
] ],
// 模块 // 模块
,modules: 'lay,laytpl,laypage,laydate,jquery,layer,util,dropdown,slider,colorpicker,element,upload,form,table,treeTable,tree,transfer,carousel,rate,flow,code' modules: 'lay,laytpl,laypage,laydate,jquery,layer,util,dropdown,slider,colorpicker,element,upload,form,table,treeTable,tree,transfer,carousel,rate,flow,code'
}; };
// 获取参数 // 获取参数
@ -38,8 +38,8 @@ const dir = {
// 输出目录 // 输出目录
const dest = ({ const dest = ({
dist: './dist' dist: './dist',
,rls: dir.rls + '/layui' rls: dir.rls + '/layui'
}[argv.dest || 'dist'] || argv.dest) + (argv.vs ? '/'+ pkg.version : ''); }[argv.dest || 'dist'] || argv.dest) + (argv.vs ? '/'+ pkg.version : '');
// js // js
@ -150,21 +150,21 @@ exports.help = () => {
let usage = '\nUsage: gulp [options] tasks'; let usage = '\nUsage: gulp [options] tasks';
let parser = yargs.usage(usage, { let parser = yargs.usage(usage, {
dest: { dest: {
type: 'string' type: 'string',
,desc: '定义输出目录可选项dist默认、rls、任意路径' desc: '定义输出目录可选项dist默认、rls、任意路径'
} },
,vs: { vs: {
type: 'boolean' type: 'boolean',
,desc: '生成一个带版本号的文件夹' desc: '生成一个带版本号的文件夹'
} }
}); });
parser.showHelp(console.log); parser.showHelp(console.log);
console.log([ console.log([
'Tasks:' 'Tasks:',
,' default 默认任务' ' default 默认任务',
,' rls 发行任务' ' rls 发行任务',
,' cp 将 dist 目录复制一份到参数 --dest 指向的目录' ' cp 将 dist 目录复制一份到参数 --dest 指向的目录'
].join('\n'), '\n\nExamples:\n gulp cp --dest ./v --vs', '\n'); ].join('\n'), '\n\nExamples:\n gulp cp --dest ./v --vs', '\n');
return gulp.src('./'); return gulp.src('./');
}; };