@dcloudio/uni-cli-shared 2.0.1-alpha-36020220830002 → 2.0.1-alpha-36020220901001

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.
Files changed (2) hide show
  1. package/lib/preprocess.js +17 -3
  2. package/package.json +2 -2
package/lib/preprocess.js CHANGED
@@ -5,7 +5,10 @@ const DEFAULT_KEYS = [
5
5
  'APP',
6
6
  'APP-PLUS-NVUE',
7
7
  'APP-VUE',
8
- 'APP-NVUE'
8
+ 'APP-NVUE',
9
+ 'APP-ANDROID',
10
+ 'APP-IOS',
11
+ 'WEB'
9
12
  ]
10
13
 
11
14
  function normalize (name) {
@@ -44,14 +47,25 @@ module.exports = function initPreprocess (name, platforms, userDefines = {}) {
44
47
  nvueContext.APP_PLUS = true
45
48
  nvueContext.APP_NVUE = true
46
49
  nvueContext.APP_PLUS_NVUE = true
47
- }
48
50
 
51
+ if (process.env.UNI_APP_PLATFORM === 'android') {
52
+ defaultContext.APP_ANDROID = true
53
+ } else if (process.env.UNI_APP_PLATFORM === 'ios') {
54
+ defaultContext.APP_IOS = true
55
+ } else {
56
+ defaultContext.APP_ANDROID = true
57
+ defaultContext.APP_IOS = true
58
+ }
59
+ }
60
+ if (name === 'h5') {
61
+ defaultContext.WEB = true
62
+ }
49
63
  if (name.startsWith('mp-')) {
50
64
  vueContext.MP = true
51
65
  }
52
66
 
53
67
  if (name.startsWith('app-')) {
54
- vueContext.APP = true
68
+ vueContext.APP = true
55
69
  nvueContext.APP = true
56
70
  }
57
71
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/uni-cli-shared",
3
- "version": "2.0.1-alpha-36020220830002",
3
+ "version": "2.0.1-alpha-36020220901001",
4
4
  "description": "uni-cli-shared",
5
5
  "main": "lib/index.js",
6
6
  "repository": {
@@ -25,5 +25,5 @@
25
25
  "postcss-urlrewrite": "^0.2.2",
26
26
  "strip-json-comments": "^2.0.1"
27
27
  },
28
- "gitHead": "c3cd2073bb4e67dcb6d6a1ac9e98a461fc4ebd33"
28
+ "gitHead": "734c563240436d5f63a8200d676ccc8bead9f10d"
29
29
  }