From 38361ee0a1e906413807e77954872ca4d8580b34 Mon Sep 17 00:00:00 2001 From: aixianling Date: Wed, 20 Apr 2022 11:05:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=87=AA=E5=8A=A8=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/build.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/project/build.js b/project/build.js index 70de82c..4d45706 100644 --- a/project/build.js +++ b/project/build.js @@ -87,17 +87,20 @@ const init = () => { const generateMain = project => { const getApps = new Promise(resolve => { const appLib = path.join(__dirname, project.toString(), 'apps.import.json') + fsExtra.readJson(appLib, (err, data) => { chalkTag.info(project + '加载业务应用配置...') let apps = [] if (data) { fsExtra.emptyDirSync(`project/${project}/apps`) - findApp('src/mods', file => { - apps.push(file) - }).then(() => { + Promise.all([ + findApp(`src/project/${project}`, f => apps.push(f)), + findApp('src/mods', file => apps.push(file)) + ]).then(() => { Promise.all(Object.keys(data).map(e => { let app = [...new Set(apps)].find(s => s.indexOf(e) > -1) if (app) { + log('应用#%s#加载中...', e) return copyFiles(`project/${project}/apps/${e}`, app) } })).then(() => { @@ -105,6 +108,7 @@ const generateMain = project => { resolve() }) }) + } else { chalkTag.done(project + '业务应用无打包') resolve()