From 7e8eec0f5612acddce14d84a5b6d8f03be7b8aa0 Mon Sep 17 00:00:00 2001 From: winixt Date: Tue, 10 Jan 2023 18:01:52 +0800 Subject: [PATCH] fix: build cache --- .../fes-preset-built-in/src/plugins/commands/dev/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/fes-preset-built-in/src/plugins/commands/dev/index.js b/packages/fes-preset-built-in/src/plugins/commands/dev/index.js index b5b88c0e..dcd6dd34 100644 --- a/packages/fes-preset-built-in/src/plugins/commands/dev/index.js +++ b/packages/fes-preset-built-in/src/plugins/commands/dev/index.js @@ -5,10 +5,14 @@ const assert = require('assert'); const path = require('path'); +const fs = require('fs'); async function handleCacheClean(cwd) { return new Promise((resolve, reject) => { const cachePath = path.join(cwd, '.cache/webpack'); + if (!fs.existsSync(cachePath)) { + return resolve(); + } require('get-folder-size')(cachePath, (err, size) => { if (err) { return reject(err);