From 733e6ce94139c6fb7a53b756e42bae11a390c3e9 Mon Sep 17 00:00:00 2001 From: yutent Date: Sun, 19 Feb 2023 20:34:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=AE=E5=BD=95=E4=B8=8D=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/prod.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/prod.js b/lib/prod.js index cee35bb..26dd654 100644 --- a/lib/prod.js +++ b/lib/prod.js @@ -107,9 +107,11 @@ export default function compile(root = '', dist = '', conf = {}) { } fs.ls(PUBLIC_DIR, true).forEach(it => { - let name = it.slice(PUBLIC_DIR.length + 1) - console.log('正在复制静态文件 %s ...', name) - fs.cp(it, join(dist, name)) + if (fs.isfile(it)) { + let name = it.slice(PUBLIC_DIR.length + 1) + console.log('正在复制静态文件 %s ...', name) + fs.cp(it, join(dist, name)) + } }) }