From cf87a14235f8a2e7ac7586ddd0ade8eed253a142 Mon Sep 17 00:00:00 2001 From: qiang Date: Wed, 19 Aug 2020 15:47:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BD=9C=E7=94=A8?= =?UTF-8?q?=E5=9F=9F=E6=8F=92=E6=A7=BD=E5=86=85=20easycom=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20question/103407?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/plugin/generate-json.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/webpack-uni-mp-loader/lib/plugin/generate-json.js b/packages/webpack-uni-mp-loader/lib/plugin/generate-json.js index ea0ac20c3..42b9c4413 100644 --- a/packages/webpack-uni-mp-loader/lib/plugin/generate-json.js +++ b/packages/webpack-uni-mp-loader/lib/plugin/generate-json.js @@ -105,6 +105,12 @@ module.exports = function generateJson (compilation) { } delete jsonObj.usingGlobalComponents + // usingAutoImportComponents + if (jsonObj.usingAutoImportComponents && Object.keys(jsonObj.usingAutoImportComponents).length) { + jsonObj.usingComponents = Object.assign(jsonObj.usingAutoImportComponents, jsonObj.usingComponents) + } + delete jsonObj.usingAutoImportComponents + if (jsonObj.genericComponents && jsonObj.genericComponents.length) { // scoped slots // 生成genericComponents json const genericComponents = Object.create(null) @@ -144,12 +150,6 @@ module.exports = function generateJson (compilation) { delete jsonObj.genericComponents - // usingAutoImportComponents - if (jsonObj.usingAutoImportComponents && Object.keys(jsonObj.usingAutoImportComponents).length) { - jsonObj.usingComponents = Object.assign(jsonObj.usingAutoImportComponents, jsonObj.usingComponents) - } - delete jsonObj.usingAutoImportComponents - if (process.env.UNI_PLATFORM !== 'app-plus' && process.env.UNI_PLATFORM !== 'h5') { delete jsonObj.navigationBarShadow } @@ -195,4 +195,4 @@ module.exports = function generateJson (compilation) { require('@dcloudio/uni-cli-shared/lib/cache').store() }, 50) } -} +} -- GitLab