@mpxjs/cli-shared-utils 2.2.12 → 2.2.16
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 +2 -0
- package/lib/target.js +7 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
const { makeMap, runServiceCommand, removeArgv, normalizeCommandArgs } = require('./utils')
|
|
8
8
|
const {
|
|
9
9
|
SUPPORT_MODE,
|
|
10
|
+
SUPPORT_PLUGIN_MODE,
|
|
10
11
|
MODE_CONFIG_FILES_MAP,
|
|
11
12
|
DEFAULT_MODE,
|
|
12
13
|
getCurrentTarget,
|
|
@@ -25,6 +26,7 @@ const { getMpxPluginOptions } = require('./mpx')
|
|
|
25
26
|
const { setServerBundle, getServerBundle } = require('./serverBundle')
|
|
26
27
|
|
|
27
28
|
module.exports.SUPPORT_MODE = SUPPORT_MODE
|
|
29
|
+
module.exports.SUPPORT_PLUGIN_MODE = SUPPORT_PLUGIN_MODE
|
|
28
30
|
module.exports.MODE_CONFIG_FILES_MAP = MODE_CONFIG_FILES_MAP
|
|
29
31
|
module.exports.DEFAULT_MODE = DEFAULT_MODE
|
|
30
32
|
module.exports.runServiceCommand = runServiceCommand
|
package/lib/target.js
CHANGED
|
@@ -10,6 +10,8 @@ const { makeMap } = require('./utils')
|
|
|
10
10
|
*/
|
|
11
11
|
const SUPPORT_MODE = ['wx', 'ali', 'swan', 'qq', 'tt', 'dd', 'ks', 'web', 'tenon', 'android', 'ios', 'harmony', 'jd']
|
|
12
12
|
|
|
13
|
+
const SUPPORT_PLUGIN_MODE = ['wx', 'ali']
|
|
14
|
+
|
|
13
15
|
/**
|
|
14
16
|
* @type { Object.<Mode, string[]> }
|
|
15
17
|
*/
|
|
@@ -101,6 +103,10 @@ function getCurrentTarget () {
|
|
|
101
103
|
mode: process.env.MPX_CURRENT_TARGET_MODE,
|
|
102
104
|
env: process.env.MPX_CURRENT_TARGET_ENV
|
|
103
105
|
}
|
|
106
|
+
const configFileList = MODE_CONFIG_FILES_MAP[currentTarget.mode]
|
|
107
|
+
if (configFileList && configFileList.length) {
|
|
108
|
+
currentTarget.configFile = configFileList[0]
|
|
109
|
+
}
|
|
104
110
|
return currentTarget
|
|
105
111
|
}
|
|
106
112
|
|
|
@@ -112,3 +118,4 @@ module.exports.rawTarget = rawTarget
|
|
|
112
118
|
module.exports.SUPPORT_MODE = SUPPORT_MODE
|
|
113
119
|
module.exports.MODE_CONFIG_FILES_MAP = MODE_CONFIG_FILES_MAP
|
|
114
120
|
module.exports.DEFAULT_MODE = DEFAULT_MODE
|
|
121
|
+
module.exports.SUPPORT_PLUGIN_MODE = SUPPORT_PLUGIN_MODE
|