@dcloudio/uni-cli-shared 2.0.2-alpha-5010220260604002 → 2.0.2-alpha-5010420260626002
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/platform.js +6 -4
- package/lib/stat.js +21 -0
- package/package.json +2 -2
package/lib/platform.js
CHANGED
|
@@ -83,8 +83,8 @@ function isEnableConsole () {
|
|
|
83
83
|
process.env.UNI_SOCKET_PORT &&
|
|
84
84
|
process.env.UNI_SOCKET_ID &&
|
|
85
85
|
// 环境变量传入有bug,临时屏蔽安卓平台开启 uni-console
|
|
86
|
-
process.env.UNI_APP_PLATFORM !== 'android' &&
|
|
87
|
-
process.env.UNI_APP_PLATFORM !== 'ios'
|
|
86
|
+
process.env.UNI_APP_PLATFORM !== 'android' &&
|
|
87
|
+
process.env.UNI_APP_PLATFORM !== 'ios'
|
|
88
88
|
)
|
|
89
89
|
}
|
|
90
90
|
|
|
@@ -97,6 +97,7 @@ const {
|
|
|
97
97
|
vueContext: preprocessContext,
|
|
98
98
|
nvueContext: nvuePreprocessContext
|
|
99
99
|
} = global.uniPlugin.preprocess
|
|
100
|
+
|
|
100
101
|
// TODO 暂时保留原有导出,减少影响,后续再整理一下
|
|
101
102
|
module.exports = {
|
|
102
103
|
normalizeNodeModules,
|
|
@@ -212,8 +213,9 @@ module.exports = {
|
|
|
212
213
|
if (!process.env.UNI_USING_STAT) {
|
|
213
214
|
return ''
|
|
214
215
|
}
|
|
215
|
-
return process.env.UNI_USING_STAT === '
|
|
216
|
-
|
|
216
|
+
return process.env.UNI_USING_STAT === 'private'
|
|
217
|
+
? 'import \'@dcloudio/uni-stat/dist/uni-cloud-stat.es.js\';'
|
|
218
|
+
: 'import \'@dcloudio/uni-stat/dist/uni-stat-public.es.js\';'
|
|
217
219
|
},
|
|
218
220
|
getPlatformPush () {
|
|
219
221
|
if (process.env.UNI_PUSH_V1) {
|
package/lib/stat.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const { hasOwn } = require('./util')
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 解析统计 enable 开关。
|
|
5
|
+
* 1. 子平台 uniStatistics.enable 显式存在 → 以子为准
|
|
6
|
+
* 2. 否则根 uniStatistics.enable 显式存在 → 继承根
|
|
7
|
+
* 3. 否则默认开启
|
|
8
|
+
*/
|
|
9
|
+
function resolveStatEnable (rootStat, platformStat) {
|
|
10
|
+
if (platformStat && hasOwn(platformStat, 'enable')) {
|
|
11
|
+
return platformStat.enable === true
|
|
12
|
+
}
|
|
13
|
+
if (rootStat && hasOwn(rootStat, 'enable')) {
|
|
14
|
+
return rootStat.enable === true
|
|
15
|
+
}
|
|
16
|
+
return true
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
module.exports = {
|
|
20
|
+
resolveStatEnable
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/uni-cli-shared",
|
|
3
|
-
"version": "2.0.2-alpha-
|
|
3
|
+
"version": "2.0.2-alpha-5010420260626002",
|
|
4
4
|
"description": "uni-cli-shared",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"postcss-urlrewrite": "^0.2.2",
|
|
28
28
|
"strip-json-comments": "^2.0.1"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "e8896942ca8268595233f9ec566d8ae0a475696d"
|
|
31
31
|
}
|