From 1ca51c171c9d4bf404c669c8088ab90e51030929 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Tue, 20 Aug 2019 19:17:22 +0800 Subject: [PATCH] feat(stat): check appid --- packages/vue-cli-plugin-uni/lib/env.js | 24 +++++++++++++----------- packages/vue-cli-plugin-uni/package.json | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/vue-cli-plugin-uni/lib/env.js b/packages/vue-cli-plugin-uni/lib/env.js index c5231e6c..01af2bee 100644 --- a/packages/vue-cli-plugin-uni/lib/env.js +++ b/packages/vue-cli-plugin-uni/lib/env.js @@ -70,13 +70,13 @@ const uniStatistics = Object.assign( platformOptions.uniStatistics || {} ) -if (uniStatistics.enable === true) { +if (uniStatistics.enable !== false) { if (process.UNI_STAT_CONFIG.appid) { process.env.UNI_USING_STAT = true } else { - // console.log() - // console.warn(``) - // console.log() + console.log() + console.warn(`当前应用未配置Appid,无法使用uni统计,详情参考:https://ask.dcloud.net.cn/article/36303`) + console.log() } } @@ -154,13 +154,15 @@ if (platformOptions.usingComponents === true) { } } -if (process.env.UNI_USING_COMPONENTS && isSupportSubPackages()) { // 是否启用分包优化 - if ( - platformOptions.optimization && - platformOptions.optimization.subPackages && - Object.keys(process.UNI_SUBPACKAGES).length - ) { - process.env.UNI_OPT_SUBPACKAGES = true +if (process.env.UNI_USING_COMPONENTS) { // 是否启用分包优化 + if (platformOptions.optimization) { + if ( + isSupportSubPackages() && + platformOptions.optimization.subPackages && + Object.keys(process.UNI_SUBPACKAGES).length + ) { + process.env.UNI_OPT_SUBPACKAGES = true + } } } diff --git a/packages/vue-cli-plugin-uni/package.json b/packages/vue-cli-plugin-uni/package.json index bd5a2ee8..aef6b562 100644 --- a/packages/vue-cli-plugin-uni/package.json +++ b/packages/vue-cli-plugin-uni/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/vue-cli-plugin-uni", - "version": "0.9.522", + "version": "0.9.524", "description": "uni-app plugin for vue-cli 3", "main": "index.js", "scripts": { -- GitLab