@dcloudio/vue-cli-plugin-hbuilderx 2.0.1-alpha-34620220415002 → 2.0.1-alpha-34820220426002

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.
@@ -86,7 +86,9 @@ const plugins = [
86
86
  UNI_CLOUD_PROVIDER: process.env.UNI_CLOUD_PROVIDER,
87
87
  UNICLOUD_DEBUG: process.env.UNICLOUD_DEBUG,
88
88
  RUN_BY_HBUILDERX: process.env.RUN_BY_HBUILDERX,
89
- UNI_AUTOMATOR_WS_ENDPOINT: JSON.stringify(process.env.UNI_AUTOMATOR_WS_ENDPOINT)
89
+ UNI_AUTOMATOR_WS_ENDPOINT: JSON.stringify(process.env.UNI_AUTOMATOR_WS_ENDPOINT),
90
+ UNI_STAT_UNI_CLOUD: process.env.UNI_STAT_UNI_CLOUD || '',
91
+ UNI_STAT_DEBUG: process.env.UNI_STAT_DEBUG || ''
90
92
  }
91
93
  }),
92
94
  new webpack.BannerPlugin({
@@ -316,6 +318,7 @@ module.exports = function () {
316
318
  extensions: ['.js', '.nvue', '.vue', '.json'],
317
319
  alias: {
318
320
  '@': process.env.UNI_INPUT_DIR,
321
+ 'uni-polyfill': require.resolve('@dcloudio/uni-cli-shared/lib/uni-polyfill.js'),
319
322
  'uni-pages': path.resolve(process.env.UNI_INPUT_DIR, 'pages.json'),
320
323
  'uni-app-style': path.resolve(process.env.UNI_INPUT_DIR, getNVueMainEntry()) + '?' + JSON.stringify({
321
324
  type: 'appStyle'
@@ -389,4 +392,4 @@ module.exports = function () {
389
392
  zlib: false
390
393
  }
391
394
  }
392
- }
395
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/vue-cli-plugin-hbuilderx",
3
- "version": "2.0.1-alpha-34620220415002",
3
+ "version": "2.0.1-alpha-34820220426002",
4
4
  "description": "HBuilderX plugin for vue-cli 3",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -18,5 +18,5 @@
18
18
  "css": "~2.2.1",
19
19
  "escodegen": "^1.8.1"
20
20
  },
21
- "gitHead": "c2c5b0345d72c1cfb51645719ce260a5c1d0d0f7"
21
+ "gitHead": "a372254d8032fd7d4b9c2bde5dfec0fef7ce0d84"
22
22
  }
@@ -59,22 +59,8 @@ module.exports = function (content, map) {
59
59
  return `
60
60
  ${statCode}
61
61
  import 'uni-app-style'
62
+ import 'uni-polyfill'
62
63
  import App from './${normalizePath(params.page)}.nvue?mpType=page'
63
- if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
64
- Promise.prototype.finally = function(callback) {
65
- var promise = this.constructor
66
- return this.then(function(value) {
67
- return promise.resolve(callback()).then(function() {
68
- return value
69
- })
70
- }, function(reason) {
71
- return promise.resolve(callback()).then(function() {
72
- throw reason
73
- })
74
- })
75
- }
76
- }
77
- ArrayBuffer = uni.base64ToArrayBuffer('').constructor
78
64
  App.mpType = 'page'
79
65
  App.route = '${params.page}'
80
66
  App.el = '#root'
@@ -8,7 +8,6 @@ module.exports = function (content, map) {
8
8
  this.callback(null, 'module.exports = ' + genStyleString(content, this), map)
9
9
  }
10
10
  const uniI18n = require('@dcloudio/uni-cli-i18n')
11
- const print = require('../../../util/console')
12
11
 
13
12
  // @todo:
14
13
  // font-relative lengths: em, ex, ch, ic
@@ -60,13 +59,13 @@ function genStyleString (input, loader) {
60
59
  msgs.forEach(msg => {
61
60
  switch (msg.split(':')[0]) {
62
61
  case 'ERROR':
63
- print.error(msg)
62
+ console.error(msg)
64
63
  break
65
64
  case 'WARNING' :
66
- print.warn(msg)
65
+ console.warn(msg)
67
66
  break
68
67
  default:
69
- print.log(msg)
68
+ console.log(msg)
70
69
  break
71
70
  }
72
71
  })
package/util/console.js DELETED
@@ -1,23 +0,0 @@
1
- const ZERO_WIDTH_CHAR = {
2
- NOTE: '',
3
- WARNING: '\u200B',
4
- ERROR: '\u200C',
5
- backup0: '\u200D',
6
- backup1: '\u200E',
7
- backup2: '\u200F',
8
- backup3: '\uFEFF'
9
- }
10
-
11
- module.exports = {
12
- warn (msg) {
13
- msg = ZERO_WIDTH_CHAR.WARNING + msg + ZERO_WIDTH_CHAR.WARNING
14
- console.warn(msg)
15
- },
16
- error (msg) {
17
- msg = ZERO_WIDTH_CHAR.ERROR + msg + ZERO_WIDTH_CHAR.ERROR
18
- console.error(msg)
19
- },
20
- log (msg) {
21
- console.log(msg)
22
- }
23
- }