1 Star 0 Fork 0

代码织梦师/Ranch-admin

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
refreshThelingAntd.ts 824 Bytes
一键复制 编辑 原始数据 按行查看 历史
A.ZJT(涛涛) 提交于 2023-09-19 19:19 +08:00 . feat: 全局刷新依赖方法构建
const rimrafAntd = require('rimraf');
const execSyncAntd = require('child_process').execSync;
const refreshThelingAntd = async () => {
await Promise.all([
await removeDirAntd('src/.umi'),
await removeDirAntd('node_modules/.cache'),
await removeDirAntd('pnpm-lock.yaml'),
]);
try {
execSyncAntd('pnpm remove @theling/antd', { stdio: 'inherit' });
} catch (e) {
console.log('移除旧的依赖失败', e);
}
execSyncAntd('pnpm store prune', { stdio: 'inherit' });
// 安装最新的依赖
execSyncAntd('pnpm i @theling/antd --force', { stdio: 'inherit' });
};
const removeDirAntd = (dir: any) =>
new Promise((resolve, reject) => {
rimrafAntd(dir, (err: any) => {
if (err) {
reject(err);
} else {
resolve({});
}
});
});
refreshThelingAntd();
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhao-jingtao-l/ranch-admin.git
git@gitee.com:zhao-jingtao-l/ranch-admin.git
zhao-jingtao-l
ranch-admin
Ranch-admin
master

搜索帮助