提交 4a8a5d3e 编写于 作者: fxy060608's avatar fxy060608

fix(stat): improve UNI_USING_STAT logic

上级 80ba08d9
......@@ -65,21 +65,6 @@ process.UNI_STAT_CONFIG = {
appid: manifestJsonObj.appid
}
const uniStatistics = Object.assign(
manifestJsonObj.uniStatistics || {},
platformOptions.uniStatistics || {}
)
if (uniStatistics.enable !== false) {
if (process.UNI_STAT_CONFIG.appid) {
process.env.UNI_USING_STAT = true
} else {
console.log()
console.warn(`当前应用未配置Appid,无法使用uni统计,详情参考:https://ask.dcloud.net.cn/article/36303`)
console.log()
}
}
// fixed by hxy alpha 版默认启用新的框架
if (isInHBuilderXAlpha) {
if (!platformOptions.hasOwnProperty('usingComponents')) {
......@@ -154,6 +139,23 @@ if (platformOptions.usingComponents === true) {
}
}
if (process.env.UNI_USING_COMPONENTS || process.env.UNI_PLATFORM === 'h5') { // 自定义组件模式或 h5 平台
const uniStatistics = Object.assign(
manifestJsonObj.uniStatistics || {},
platformOptions.uniStatistics || {}
)
if (uniStatistics.enable !== false) {
if (process.UNI_STAT_CONFIG.appid) {
process.env.UNI_USING_STAT = true
} else {
console.log()
console.warn(`当前应用未配置Appid,无法使用uni统计,详情参考:https://ask.dcloud.net.cn/article/36303`)
console.log()
}
}
}
if (process.env.UNI_USING_COMPONENTS) { // 是否启用分包优化
if (platformOptions.optimization) {
if (
......
{
"name": "@dcloudio/vue-cli-plugin-uni",
"version": "0.9.524",
"version": "0.9.525",
"description": "uni-app plugin for vue-cli 3",
"main": "index.js",
"scripts": {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册