@dcloudio/uni-cli-shared 2.0.2-4040520250103001 → 2.0.2-4050320250303001

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/index.js CHANGED
@@ -63,12 +63,16 @@ const {
63
63
  getPlatformGlobal,
64
64
  getPlatformStat,
65
65
  getPlatformPush,
66
- getPlatformUniCloud
66
+ getPlatformUniCloud,
67
+ getDevUniConsoleCode
67
68
  } = require('./platform')
68
69
 
69
70
  const uts = require('./uts')
70
71
 
71
- const { parseTheme, initTheme } = require('./theme')
72
+ const {
73
+ parseTheme,
74
+ initTheme
75
+ } = require('./theme')
72
76
 
73
77
  module.exports = {
74
78
  uts,
@@ -125,5 +129,6 @@ module.exports = {
125
129
  getPlatformPush,
126
130
  getPlatformUniCloud,
127
131
  parseTheme,
128
- initTheme
132
+ initTheme,
133
+ getDevUniConsoleCode
129
134
  }
package/lib/manifest.js CHANGED
@@ -47,7 +47,17 @@ function getH5Options (manifestJson) {
47
47
  manifestJson = getManifestJson()
48
48
  }
49
49
 
50
- const h5 = manifestJson[process.env.UNI_SUB_PLATFORM || process.env.UNI_PLATFORM] || {}
50
+ let h5 = {}
51
+
52
+ if (process.env.UNI_SUB_PLATFORM) {
53
+ h5 = manifestJson[process.env.UNI_SUB_PLATFORM] || {}
54
+ } else {
55
+ if (process.env.UNI_PLATFORM === 'h5') {
56
+ h5 = manifestJson.web || manifestJson.h5 || {}
57
+ } else {
58
+ h5 = manifestJson[process.env.UNI_PLATFORM] || {}
59
+ }
60
+ }
51
61
 
52
62
  h5.appid = (manifestJson.appid || '').replace('__UNI__', '')
53
63
 
package/lib/platform.js CHANGED
@@ -75,6 +75,15 @@ function createShadowImageUrl (cdn, type = 'grey') {
75
75
  return `https://cdn${cdn || ''}.dcloud.net.cn/${identStr}img/shadow-${type}.png`
76
76
  }
77
77
 
78
+ function isEnableConsole () {
79
+ return !!(
80
+ process.env.NODE_ENV === 'development' &&
81
+ process.env.UNI_SOCKET_HOSTS &&
82
+ process.env.UNI_SOCKET_PORT &&
83
+ process.env.UNI_SOCKET_ID
84
+ )
85
+ }
86
+
78
87
  // 解决 vue-cli-service lint 时 UNI_PLATFORM 不存在
79
88
  process.env.UNI_PLATFORM = process.env.UNI_PLATFORM || 'h5'
80
89
 
@@ -239,5 +248,12 @@ module.exports = {
239
248
  'classProperties'
240
249
  ]
241
250
  }
251
+ },
252
+ isEnableConsole,
253
+ getDevUniConsoleCode () {
254
+ if (isEnableConsole()) {
255
+ return 'import \'@dcloudio/uni-console\';\n'
256
+ }
257
+ return ''
242
258
  }
243
259
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-cli-shared",
3
- "version": "2.0.2-4040520250103001",
3
+ "version": "2.0.2-4050320250303001",
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": "e6f67aab2109f4f519e46d9fc214b6c2c0edc6bc"
30
+ "gitHead": "a2b65079c08db2a886090289a98e78eb4680e3e7"
31
31
  }