diff --git a/lib/prod.js b/lib/prod.js index 2b6bb03..0c99166 100644 --- a/lib/prod.js +++ b/lib/prod.js @@ -22,7 +22,9 @@ export default function compile(root = '', dist = '', conf = {}) { path: it, ext: parse(it).ext })) - .filter(it => fs.isfile(it.path)) + .filter(it => fs.isfile(it.path) && it.ext !== '') + + console.log(list) let compileFiles = function (currentPage, page, files) { for (let it of files) { @@ -115,12 +117,19 @@ export default function compile(root = '', dist = '', conf = {}) { return } let idx = list.findIndex(_ => _.path === it) + let name = it.slice(dir.length + 1) + let ext = parse(name).ext + + if (ext === '') { + return + } + list.splice(idx, 1) files.push({ - name: it.slice(dir.length + 1), + name, path: it, - ext: parse(it).ext + ext }) }) } @@ -137,6 +146,12 @@ export default function compile(root = '', dist = '', conf = {}) { if (fs.isdir(PUBLIC_DIR)) { console.log('\n正在处理静态资源 ...') fs.ls(PUBLIC_DIR, true).forEach(it => { + let ext = parse(it).ext + + if (ext === '') { + return + } + if (fs.isfile(it)) { let name = it.slice(PUBLIC_DIR.length + 1) console.log(' 复制 %s ...', name)