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)) + } }) }