@dcloudio/vue-cli-plugin-hbuilderx 2.0.1-alpha-34220220310003 → 2.0.1-alpha-34420220402001
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.
|
@@ -317,7 +317,6 @@ module.exports = function () {
|
|
|
317
317
|
alias: {
|
|
318
318
|
'@': process.env.UNI_INPUT_DIR,
|
|
319
319
|
'uni-pages': path.resolve(process.env.UNI_INPUT_DIR, 'pages.json'),
|
|
320
|
-
'@dcloudio/uni-stat': require.resolve('@dcloudio/uni-stat'),
|
|
321
320
|
'uni-app-style': path.resolve(process.env.UNI_INPUT_DIR, getNVueMainEntry()) + '?' + JSON.stringify({
|
|
322
321
|
type: 'appStyle'
|
|
323
322
|
}),
|
package/module-alias.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
const fs = require('fs')
|
|
2
|
-
const path = require('path')
|
|
3
|
-
const moduleAlias = require('module-alias')
|
|
4
|
-
|
|
5
|
-
const {
|
|
6
|
-
hasModule
|
|
7
|
-
} = require('@dcloudio/uni-cli-shared/lib/util')
|
|
8
|
-
|
|
9
|
-
const isInHBuilderX = fs.existsSync(path.resolve(process.env.UNI_CLI_CONTEXT, 'bin/uniapp-cli.js'))
|
|
10
|
-
|
|
11
|
-
// nvue override
|
|
12
|
-
moduleAlias.addAlias('weex-styler', path.resolve(__dirname, 'packages/weex-styler'))
|
|
13
|
-
moduleAlias.addAlias('weex-template-compiler', path.resolve(__dirname, 'packages/weex-template-compiler'))
|
|
14
|
-
moduleAlias.addAlias('@vue/component-compiler-utils', require.resolve(
|
|
15
|
-
'@dcloudio/vue-cli-plugin-uni/packages/@vue/component-compiler-utils'))
|
|
16
|
-
moduleAlias.addAlias('@vue/component-compiler-utils/package.json', require.resolve(
|
|
17
|
-
'@dcloudio/vue-cli-plugin-uni/packages/@vue/component-compiler-utils/package.json'))
|
|
18
|
-
|
|
19
|
-
if (isInHBuilderX) {
|
|
20
|
-
moduleAlias.addAlias('typescript', path.resolve(process.env.UNI_HBUILDERX_PLUGINS,
|
|
21
|
-
'compile-typescript/node_modules/typescript'))
|
|
22
|
-
moduleAlias.addAlias('less', path.resolve(process.env.UNI_HBUILDERX_PLUGINS,
|
|
23
|
-
'compile-less/node_modules/less'))
|
|
24
|
-
moduleAlias.addAlias('node-sass', path.resolve(process.env.UNI_HBUILDERX_PLUGINS,
|
|
25
|
-
'compile-node-sass/node_modules/node-sass-china'))
|
|
26
|
-
moduleAlias.addAlias('stylus', path.resolve(process.env.UNI_HBUILDERX_PLUGINS,
|
|
27
|
-
'compile-stylus/node_modules/stylus'))
|
|
28
|
-
moduleAlias.addAlias('pug', path.resolve(process.env.UNI_HBUILDERX_PLUGINS,
|
|
29
|
-
'compile-pug-cli/node_modules/pug'))
|
|
30
|
-
|
|
31
|
-
if (!hasModule('typescript')) { // 因为 cli-plugin-typescript 会直接读取typescript/package.json,故,如果未安装 typescript,则先设置一个假的
|
|
32
|
-
moduleAlias.addAlias('typescript/package.json', path.resolve(__dirname, 'typescript.json'))
|
|
33
|
-
moduleAlias.addAlias('fork-ts-checker-webpack-plugin', path.resolve(__dirname,
|
|
34
|
-
'fork-ts-checker-webpack-plugin.fake.js'))
|
|
35
|
-
}
|
|
2
|
+
const path = require('path')
|
|
3
|
+
const moduleAlias = require('module-alias')
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
hasModule
|
|
7
|
+
} = require('@dcloudio/uni-cli-shared/lib/util')
|
|
8
|
+
|
|
9
|
+
const isInHBuilderX = fs.existsSync(path.resolve(process.env.UNI_CLI_CONTEXT, 'bin/uniapp-cli.js'))
|
|
10
|
+
|
|
11
|
+
// nvue override
|
|
12
|
+
moduleAlias.addAlias('weex-styler', path.resolve(__dirname, 'packages/weex-styler'))
|
|
13
|
+
moduleAlias.addAlias('weex-template-compiler', path.resolve(__dirname, 'packages/weex-template-compiler'))
|
|
14
|
+
moduleAlias.addAlias('@vue/component-compiler-utils', require.resolve(
|
|
15
|
+
'@dcloudio/vue-cli-plugin-uni/packages/@vue/component-compiler-utils'))
|
|
16
|
+
moduleAlias.addAlias('@vue/component-compiler-utils/package.json', require.resolve(
|
|
17
|
+
'@dcloudio/vue-cli-plugin-uni/packages/@vue/component-compiler-utils/package.json'))
|
|
18
|
+
|
|
19
|
+
if (isInHBuilderX) {
|
|
20
|
+
moduleAlias.addAlias('typescript', path.resolve(process.env.UNI_HBUILDERX_PLUGINS,
|
|
21
|
+
'compile-typescript/node_modules/typescript'))
|
|
22
|
+
moduleAlias.addAlias('less', path.resolve(process.env.UNI_HBUILDERX_PLUGINS,
|
|
23
|
+
'compile-less/node_modules/less'))
|
|
24
|
+
moduleAlias.addAlias('node-sass', path.resolve(process.env.UNI_HBUILDERX_PLUGINS,
|
|
25
|
+
'compile-node-sass/node_modules/node-sass-china'))
|
|
26
|
+
moduleAlias.addAlias('stylus', path.resolve(process.env.UNI_HBUILDERX_PLUGINS,
|
|
27
|
+
'compile-stylus/node_modules/stylus'))
|
|
28
|
+
moduleAlias.addAlias('pug', path.resolve(process.env.UNI_HBUILDERX_PLUGINS,
|
|
29
|
+
'compile-pug-cli/node_modules/pug'))
|
|
30
|
+
|
|
31
|
+
if (!hasModule('typescript')) { // 因为 cli-plugin-typescript 会直接读取typescript/package.json,故,如果未安装 typescript,则先设置一个假的
|
|
32
|
+
moduleAlias.addAlias('typescript/package.json', path.resolve(__dirname, 'typescript.json'))
|
|
33
|
+
moduleAlias.addAlias('fork-ts-checker-webpack-plugin', path.resolve(__dirname,
|
|
34
|
+
'fork-ts-checker-webpack-plugin.fake.js'))
|
|
35
|
+
}
|
|
36
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/vue-cli-plugin-hbuilderx",
|
|
3
|
-
"version": "2.0.1-alpha-
|
|
3
|
+
"version": "2.0.1-alpha-34420220402001",
|
|
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": "
|
|
21
|
+
"gitHead": "5590cdf746ea715abe4dd71aa0392f600003bf06"
|
|
22
22
|
}
|
|
@@ -12,7 +12,8 @@ const {
|
|
|
12
12
|
} = require('vue-loader/lib/codegen/utils')
|
|
13
13
|
|
|
14
14
|
const {
|
|
15
|
-
normalizePath
|
|
15
|
+
normalizePath,
|
|
16
|
+
getPlatformStat
|
|
16
17
|
} = require('@dcloudio/uni-cli-shared')
|
|
17
18
|
|
|
18
19
|
const appVuePath = path.resolve(process.env.UNI_INPUT_DIR, 'App.vue')
|
|
@@ -47,7 +48,7 @@ module.exports = function (content, map) {
|
|
|
47
48
|
|
|
48
49
|
const loaderContext = this
|
|
49
50
|
|
|
50
|
-
const statCode =
|
|
51
|
+
const statCode = getPlatformStat()
|
|
51
52
|
|
|
52
53
|
if (this.resourceQuery) {
|
|
53
54
|
const params = loaderUtils.parseQuery(this.resourceQuery)
|
|
@@ -88,4 +89,4 @@ module.exports = function (content, map) {
|
|
|
88
89
|
const automatorCode = process.env.UNI_AUTOMATOR_WS_ENDPOINT ? 'import \'@dcloudio/uni-app-plus/dist/automator\';'
|
|
89
90
|
: ''
|
|
90
91
|
return automatorCode + statCode + content
|
|
91
|
-
}
|
|
92
|
+
}
|
|
@@ -1648,6 +1648,7 @@ function parse (
|
|
|
1648
1648
|
// condense consecutive whitespaces into single space
|
|
1649
1649
|
text = text.replace(whitespaceRE, ' ');
|
|
1650
1650
|
}
|
|
1651
|
+
text = text.trim();
|
|
1651
1652
|
var res;
|
|
1652
1653
|
var child;
|
|
1653
1654
|
if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {
|