diff --git a/packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js b/packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js index 0d8558f88afd36d91db8eb8e35c2fde7c2f908d3..0dc7e52a942708d5291a738976386d5cad23c7ff 100644 --- a/packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js +++ b/packages/webpack-uni-pages-loader/lib/platforms/app-plus/index.js @@ -143,12 +143,23 @@ module.exports = function (pagesJson, userManifestJson, isAppView) { name: userManifestJson.versionName, code: userManifestJson.versionCode }, - locale: userManifestJson.locale + locale: userManifestJson.locale, + uniStatistics: userManifestJson.uniStatistics }, { plus: userManifestJson['app-plus'] } ) + // 根节点配置了统计 + if (manifestJson.uniStatistics) { + manifestJson.plus.uniStatistics = merge.recursive( + true, + manifestJson.uniStatistics, + manifestJson.plus.uniStatistics + ) + delete manifestJson.uniStatistics + } + const splashscreenOptions = userManifestJson['app-plus'] && userManifestJson['app-plus'].splashscreen @@ -606,4 +617,4 @@ module.exports = function (pagesJson, userManifestJson, isAppView) { ) } return [app, manifest] -} +}