1 Star 0 Fork 10

安河桥北/vue3-vant3-template

forked from fe-hl/vue3-vant4-template 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
release.js 1.20 KB
一键复制 编辑 原始数据 按行查看 历史
hl 提交于 2022-08-08 18:11 . docs: docs(模版升级): 模版升级
/**
* 打zip包,jenkins部署
*/
const log = require('@hl-cli/log');
const { spinnerStart } = require('@hl-cli/utlis');
const path = require('path');
const compressing = require('compressing');
const pathExists = require('path-exists').sync;
const fse = require('fs-extra');
const pkg = require('./package.json');
let targetPath = path.resolve(process.cwd(), pkg.name);
let sourcePathDist = path.resolve(process.cwd(), 'dist');
let targetPathDist = path.resolve(process.cwd(), targetPath + '/dist');
log.info('targetPath', targetPath);
log.info('targetPathDist', targetPathDist);
log.info('sourcePathDist', sourcePathDist);
async function taskRun() {
const spinner = spinnerStart(`正在打包${pkg.name}.zip...\n`);
try {
if (pathExists(targetPath)) {
fse.emptyDirSync(targetPath);
} else {
fse.ensureDirSync(targetPath);
}
fse.copySync(sourcePathDist, targetPathDist);
fse.removeSync(`${process.cwd()}/${pkg.name}.zip`);
await compressing.zip.compressDir(targetPath, `${pkg.name}.zip`);
log.info('zip', `${process.cwd()}/${pkg.name}.zip`);
log.success('build', '打包已完成,请提交');
spinner.stop(true);
} catch (e) {
spinner.stop(true);
log.error('异常', e.message);
}
}
taskRun();
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/mmmm96_admin/vue3-vant4-template.git
git@gitee.com:mmmm96_admin/vue3-vant4-template.git
mmmm96_admin
vue3-vant4-template
vue3-vant3-template
master

搜索帮助