mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-26 03:26:39 +08:00
fix: 修复清除webpack-cache问题
This commit is contained in:
parent
cc20923e07
commit
df78d1dcac
@ -1,8 +1,10 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
async function handleCacheClean(cwd) {
|
async function handleCacheClean(cwd) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const cachePath = path.join(cwd, '.cache/webpack');
|
const cachePath = path.join(cwd, '.cache/webpack');
|
||||||
|
if (fs.existsSync(cachePath)) {
|
||||||
require('get-folder-size')(cachePath, (err, size) => {
|
require('get-folder-size')(cachePath, (err, size) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
return reject(err);
|
return reject(err);
|
||||||
@ -14,6 +16,7 @@ async function handleCacheClean(cwd) {
|
|||||||
}
|
}
|
||||||
resolve(size);
|
resolve(size);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user