@dcloudio/vue-cli-plugin-uni 2.0.1-alpha-33720220111002 → 2.0.1-alpha-33820220114001

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/commands/build.js CHANGED
@@ -34,7 +34,7 @@ module.exports = (api, options) => {
34
34
  '--auto-host': 'specify automator host',
35
35
  '--auto-port': 'specify automator port',
36
36
  '--subpackage': 'specify subpackage',
37
- '--plugin': 'specify plugin',
37
+ '--plugin': 'specify mp plugin',
38
38
  '--manifest': 'build manifest.json'
39
39
  }
40
40
  }, async (args) => {
@@ -244,17 +244,19 @@ function analysisPluginDir () {
244
244
  const pluginJson = parseJson(fs.readFileSync(pluginJsonPath, 'utf-8'), true)
245
245
 
246
246
  // main 入口文件是否存在
247
- process.env.UNI_MP_PLUGIN_MAIN = pluginJson.main
248
- const UNI_MP_PLUGIN_MAIN = process.env.UNI_MP_PLUGIN_MAIN
249
- const mainFilePath = path.resolve(process.env.UNI_INPUT_DIR, UNI_MP_PLUGIN_MAIN)
250
-
251
- if (UNI_MP_PLUGIN_MAIN && !fs.pathExistsSync(mainFilePath)) {
252
- console.log()
253
- console.error(uniI18n.__('pluginUni.entryDileNoExistsCheckAfterRetry', {
254
- 0: UNI_MP_PLUGIN_MAIN
255
- }))
256
- console.log()
257
- process.exit(0)
247
+ if (pluginJson.main) {
248
+ process.env.UNI_MP_PLUGIN_MAIN = pluginJson.main
249
+ const UNI_MP_PLUGIN_MAIN = process.env.UNI_MP_PLUGIN_MAIN
250
+ const mainFilePath = path.resolve(process.env.UNI_INPUT_DIR, UNI_MP_PLUGIN_MAIN)
251
+
252
+ if (UNI_MP_PLUGIN_MAIN && !fs.pathExistsSync(mainFilePath)) {
253
+ console.log()
254
+ console.error(uniI18n.__('pluginUni.entryDileNoExistsCheckAfterRetry', {
255
+ 0: UNI_MP_PLUGIN_MAIN
256
+ }))
257
+ console.log()
258
+ process.exit(0)
259
+ }
258
260
  }
259
261
  }
260
262
 
package/lib/env.js CHANGED
@@ -352,9 +352,7 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
352
352
  if (process.env.UNI_PLATFORM === 'app-plus') {
353
353
  const pagesPkg = require('@dcloudio/webpack-uni-pages-loader/package.json')
354
354
  if (pagesPkg) {
355
- const v3Tips = `(v3)${uniI18n.__('see')}https://ask.dcloud.net.cn/article/36599。`
356
- info = uniI18n.__('compilerVersion') + ':' + pagesPkg['uni-app'].compilerVersion + (process.env.UNI_USING_V3
357
- ? v3Tips : '')
355
+ info = uniI18n.__('compilerVersion') + '' + pagesPkg['uni-app'].compilerVersion
358
356
  }
359
357
  if (process.env.UNI_USING_V3) {
360
358
  console.log(info)
package/lib/mp/index.js CHANGED
@@ -178,11 +178,12 @@ module.exports = {
178
178
 
179
179
  {
180
180
  const globalEnv = process.env.UNI_PLATFORM === 'mp-alipay' ? 'my' : 'wx';
181
- [].concat(process.env.UNI_MP_PLUGIN ? process.env.UNI_MP_PLUGIN_MAIN : JSON.parse(process.env
182
- .UNI_MP_PLUGIN_EXPORT))
183
- .forEach(fileName => addToUniEntry(fileName))
184
- beforeCode +=
185
- `${globalEnv}.__webpack_require_${(process.env.UNI_MP_PLUGIN || 'UNI_MP_PLUGIN').replace(/-/g, '_')}__ = __webpack_require__;`
181
+ [].concat(
182
+ process.env.UNI_MP_PLUGIN
183
+ ? process.env.UNI_MP_PLUGIN_MAIN
184
+ : JSON.parse(process.env.UNI_MP_PLUGIN_EXPORT)
185
+ ).forEach(fileName => addToUniEntry(fileName))
186
+ beforeCode += `${globalEnv}.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__;`
186
187
  }
187
188
 
188
189
  const alias = { // 仅 mp-weixin
@@ -319,4 +320,4 @@ module.exports = {
319
320
  webpackConfig.plugins.delete('preload')
320
321
  webpackConfig.plugins.delete('prefetch')
321
322
  }
322
- }
323
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/vue-cli-plugin-uni",
3
- "version": "2.0.1-alpha-33720220111002",
3
+ "version": "2.0.1-alpha-33820220114001",
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-33720220111002",
20
+ "@dcloudio/uni-stat": "^2.0.1-alpha-33820220114001",
21
21
  "buffer-json": "^2.0.0",
22
22
  "clone-deep": "^4.0.1",
23
23
  "copy-webpack-plugin": "^5.1.1",
@@ -39,5 +39,5 @@
39
39
  "wrap-loader": "^0.2.0",
40
40
  "xregexp": "4.0.0"
41
41
  },
42
- "gitHead": "6fcc582dd805b52cd3c8f7d828ca12c2e2f4cedd"
42
+ "gitHead": "20d5f695ce7acd61a5316e0ae6d77895c4c3a2f3"
43
43
  }