@dcloudio/vue-cli-plugin-hbuilderx 2.0.0-32920210926001 → 2.0.0-32920211029004

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcloudio/vue-cli-plugin-hbuilderx",
3
- "version": "2.0.0-32920210926001",
3
+ "version": "2.0.0-32920211029004",
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": "5e7404fe087c97dfc46bfa7b0ab9044a2fa90142"
21
+ "gitHead": "0e2f32a18e008c75ebc1960b9932ebaac5d012e5"
22
22
  }
@@ -8,6 +8,7 @@ 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')
11
12
 
12
13
  // @todo:
13
14
  // font-relative lengths: em, ex, ch, ic
@@ -56,7 +57,19 @@ function genStyleString (input, loader) {
56
57
  msgs.unshift(uniI18n.__('pluginHbuilderx.nvueCssWarning'))
57
58
  isFirst = false
58
59
  }
59
- msgs.forEach(msg => console.warn(msg))
60
+ msgs.forEach(msg => {
61
+ switch (msg.split(':')[0]) {
62
+ case 'ERROR':
63
+ print.error(msg)
64
+ break
65
+ case 'WARNING' :
66
+ print.warn(msg)
67
+ break
68
+ default:
69
+ print.log(msg)
70
+ break
71
+ }
72
+ })
60
73
  }
61
74
  }
62
75
  try {
@@ -0,0 +1,23 @@
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
+ }