@dcloudio/vue-cli-plugin-uni 2.0.1-alpha-36720221017002 → 2.0.1-alpha-36720221018001

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.
@@ -230,10 +230,7 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
230
230
  webpackConfig.resolve.modules = webpackConfig.resolve.modules.filter(module => module !== 'node_modules')
231
231
  }
232
232
 
233
- const plugins = [
234
- new webpack.ProvidePlugin(require('@dcloudio/uni-cli-shared/lib/uni_modules/uni_modules')
235
- .parseUniExtApis())
236
- ]
233
+ const plugins = []
237
234
 
238
235
  const isAppView = process.env.UNI_PLATFORM === 'app-plus' &&
239
236
  vueOptions.pluginOptions &&
@@ -245,6 +242,19 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
245
242
  plugins.push(new CopyWebpackPlugin(CopyWebpackPluginVersion > 5 ? {
246
243
  patterns
247
244
  } : patterns))
245
+
246
+ const uniExtApis = require('@dcloudio/uni-cli-shared/lib/uni_modules/uni_modules')
247
+ .parseUniExtApis(false)
248
+ const keys = Object.keys(uniExtApis)
249
+ if (keys.length) {
250
+ if (process.env.UNI_PLATFORM === 'app-plus') {
251
+ keys.forEach(key => {
252
+ console.warn(`[${uniExtApis[key][0].split('/')[2]}]: uts目前仅支持vue3`)
253
+ })
254
+ } else {
255
+ plugins.push(new webpack.ProvidePlugin(uniExtApis))
256
+ }
257
+ }
248
258
  }
249
259
  if (!process.env.UNI_SUBPACKGE || !process.env.UNI_MP_PLUGIN) {
250
260
  try {
package/lib/env.js CHANGED
@@ -148,6 +148,23 @@ if (process.env.UNI_OUTPUT_DIR && process.env.UNI_OUTPUT_DIR.indexOf('./') === 0
148
148
  process.env.UNI_PLATFORM = process.env.UNI_PLATFORM || 'h5'
149
149
  process.env.VUE_APP_PLATFORM = process.env.UNI_PLATFORM
150
150
  process.env.UNI_OUTPUT_DIR = process.env.UNI_OUTPUT_DIR || process.env.UNI_OUTPUT_DEFAULT_DIR
151
+ initUtsPlatform()
152
+
153
+ function initUtsPlatform () {
154
+ if (process.env.UNI_APP_PLATFORM === 'android') {
155
+ process.env.UNI_UTS_PLATFORM = 'app-android'
156
+ }
157
+ if (process.env.UNI_APP_PLATFORM === 'ios') {
158
+ process.env.UNI_UTS_PLATFORM = 'app-ios'
159
+ }
160
+ if (process.env.UNI_PLATFORM === 'h5') {
161
+ process.env.UNI_UTS_PLATFORM = 'web'
162
+ } else {
163
+ if (!process.env.UNI_UTS_PLATFORM) {
164
+ process.env.UNI_UTS_PLATFORM = process.env.UNI_PLATFORM
165
+ }
166
+ }
167
+ }
151
168
 
152
169
  if (process.env.UNI_PLATFORM === 'app-plus') {
153
170
  process.env.UNI_OUTPUT_TMP_DIR = path.resolve(process.env.UNI_OUTPUT_DIR, '../.tmp/app-plus')
@@ -367,7 +384,9 @@ if (
367
384
  } else {
368
385
  uniStatLog(`已开启 uni统计${uniStatistics.version}.0 版本`)
369
386
  if (version === '2') {
370
- uniStatLog('【重要】因 HBuilderX 3.4.9 版本起,uni统计2.0 调整了安卓端 deviceId 获取方式,导致 uni统计2.0 App-Android平台部分统计数据不准确。如使用了HBuilderX 3.4.9 - 3.6.4版本且开通了uni统计2.0的应用,需要使用HBuilderX3.6.7及以上版本重新发布应用并升级 uniAdmin 云函数解决,详见:https://ask.dcloud.net.cn/article/40097')
387
+ uniStatLog(
388
+ '【重要】因 HBuilderX 3.4.9 版本起,uni统计2.0 调整了安卓端 deviceId 获取方式,导致 uni统计2.0 App-Android平台部分统计数据不准确。如使用了HBuilderX 3.4.9 - 3.6.4版本且开通了uni统计2.0的应用,需要使用HBuilderX3.6.7及以上版本重新发布应用并升级 uniAdmin 云函数解决,详见:https://ask.dcloud.net.cn/article/40097'
389
+ )
371
390
  }
372
391
  }
373
392
  }
@@ -379,7 +398,9 @@ if (
379
398
  } else {
380
399
  uniStatLog(`已开启 uni统计${uniStatistics.version}.0 版本`)
381
400
  if (version === '2') {
382
- uniStatLog('【重要】因 HBuilderX 3.4.9 版本起,uni统计2.0 调整了安卓端 deviceId 获取方式,导致 uni统计2.0 App-Android平台部分统计数据不准确。如使用了HBuilderX 3.4.9 - 3.6.4版本且开通了uni统计2.0的应用,需要使用HBuilderX3.6.7及以上版本重新发布应用并升级 uniAdmin 云函数解决,详见:https://ask.dcloud.net.cn/article/40097')
401
+ uniStatLog(
402
+ '【重要】因 HBuilderX 3.4.9 版本起,uni统计2.0 调整了安卓端 deviceId 获取方式,导致 uni统计2.0 App-Android平台部分统计数据不准确。如使用了HBuilderX 3.4.9 - 3.6.4版本且开通了uni统计2.0的应用,需要使用HBuilderX3.6.7及以上版本重新发布应用并升级 uniAdmin 云函数解决,详见:https://ask.dcloud.net.cn/article/40097'
403
+ )
383
404
  }
384
405
  }
385
406
  }
@@ -569,4 +590,4 @@ runByHBuilderX && console.log(uniI18n.__('compiling'))
569
590
 
570
591
  module.exports = {
571
592
  manifestPlatformOptions: platformOptions
572
- }
593
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/vue-cli-plugin-uni",
3
- "version": "2.0.1-alpha-36720221017002",
3
+ "version": "2.0.1-alpha-36720221018001",
4
4
  "description": "uni-app plugin for vue-cli 3",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "author": "fxy060608",
18
18
  "license": "Apache-2.0",
19
19
  "dependencies": {
20
- "@dcloudio/uni-stat": "^2.0.1-alpha-36720221017002",
20
+ "@dcloudio/uni-stat": "^2.0.1-alpha-36720221018001",
21
21
  "buffer-json": "^2.0.0",
22
22
  "clone-deep": "^4.0.1",
23
23
  "cross-env": "^5.2.0",
@@ -41,5 +41,5 @@
41
41
  "copy-webpack-plugin": ">=5",
42
42
  "postcss": ">=7"
43
43
  },
44
- "gitHead": "fccb6f1da0c110a1ebb6f7530a60ee1388055751"
44
+ "gitHead": "472dab2237d325a51abf7784c3c8aae5a841c9d8"
45
45
  }