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 ff6d04db27564581f74b5a3b310601b867db133e..d5816c5e977ea77c681c0142627133beb48fc0f0 100644 --- a/packages/webpack-uni-mp-loader/lib/plugin/generate-json.js +++ b/packages/webpack-uni-mp-loader/lib/plugin/generate-json.js @@ -91,6 +91,9 @@ module.exports = function generateJson (compilation) { const jsonFileMap = getChangedJsonFileMap() for (let name of jsonFileMap.keys()) { const jsonObj = JSON.parse(jsonFileMap.get(name)) + if (process.env.UNI_PLATFORM === 'app-plus') { // App平台默认增加usingComponents,激活__wxAppCode__ + jsonObj.usingComponents = {} + } // customUsingComponents if (jsonObj.customUsingComponents && Object.keys(jsonObj.customUsingComponents).length) { jsonObj.usingComponents = Object.assign(jsonObj.customUsingComponents, jsonObj.usingComponents)