diff --git a/bin/build.js b/bin/build.js index 71e84e5f..6b25d5f0 100644 --- a/bin/build.js +++ b/bin/build.js @@ -58,15 +58,14 @@ module.exports = id => { manifest.h5.publicPath = extra.base || "/" let tasks = [] return generate(extra) - .then(() => customPath ? copyFiles('src/apps', 'library/project/' + customPath) : fsExtra.emptyDir('src/apps')) - .then(() => { - appList?.map(e => { - if (!/project/.test(e.id)) - tasks.push({dir: 'src/apps/' + e.name, source: 'library/apps/' + e.name}) + .then(() => customPath ? copyFiles('src/apps', 'library/project/' + customPath) : fsExtra.emptyDir('src/apps')) + .then(() => { + appList?.map(e => { + if (!/project/.test(e.id)) + tasks.push({dir: 'src/apps/' + e.name, source: 'library/apps/' + e.name}) + }) + return res.data.data }) - return Promise.all([ - copyFiles("src/components/pages", 'library/components/pages'), ...tasks.map(e => copyFiles(e.dir, e.source))]) - }).then(() => res.data.data) } else Promise.reject("无法找到项目") }) }