@dcloudio/vue-cli-plugin-hbuilderx 2.0.0-32220210818001 → 2.0.0-32920210926001
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.
|
@@ -11,7 +11,7 @@ const {
|
|
|
11
11
|
nvueHtmlPreprocessOptions,
|
|
12
12
|
getTemplatePath
|
|
13
13
|
} = require('@dcloudio/uni-cli-shared')
|
|
14
|
-
|
|
14
|
+
const fileLoader = require('@dcloudio/uni-cli-shared/lib/file-loader')
|
|
15
15
|
const WebpackAppPlusNVuePlugin = process.env.UNI_USING_V3
|
|
16
16
|
? require('../packages/webpack-app-plus-plugin')
|
|
17
17
|
: require('../packages/webpack-app-plus-nvue-plugin')
|
|
@@ -108,6 +108,9 @@ if (process.env.NODE_ENV === 'development') {
|
|
|
108
108
|
// const excludeModuleReg = /node_modules(?!(\/|\\).*(weex).*)/
|
|
109
109
|
|
|
110
110
|
const rules = [{
|
|
111
|
+
test: /\.(png|jpg|gif|ttf|eot|woff|woff2)$/i,
|
|
112
|
+
use: [fileLoader]
|
|
113
|
+
}, {
|
|
111
114
|
test: path.resolve(process.env.UNI_INPUT_DIR, 'pages.json'),
|
|
112
115
|
use: [{
|
|
113
116
|
loader: '@dcloudio/webpack-uni-pages-loader'
|
|
@@ -208,7 +211,7 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
|
|
|
208
211
|
const array = [{
|
|
209
212
|
from: path.resolve(process.env.UNI_INPUT_DIR, 'static'),
|
|
210
213
|
to: 'static'
|
|
211
|
-
}]
|
|
214
|
+
}]
|
|
212
215
|
|
|
213
216
|
const androidPrivacyPath = path.resolve(process.env.UNI_INPUT_DIR, 'androidPrivacy.json')
|
|
214
217
|
if (fs.existsSync(androidPrivacyPath)) {
|
package/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const fs = require('fs')
|
|
2
2
|
const path = require('path')
|
|
3
|
+
const uniI18n = require('@dcloudio/uni-cli-i18n')
|
|
3
4
|
|
|
4
5
|
process.env.UNI_CLI_CONTEXT = path.resolve(__dirname, '../../../')
|
|
5
6
|
|
|
@@ -18,7 +19,7 @@ module.exports = (api, options) => { // 仅处理 app-plus 相关逻辑
|
|
|
18
19
|
!process.env.UNI_USING_V3_NATIVE
|
|
19
20
|
) {
|
|
20
21
|
if (!fs.existsSync(path.resolve(process.env.UNI_HBUILDERX_PLUGINS, 'weapp-tools/lib/index.js'))) {
|
|
21
|
-
console.error('
|
|
22
|
+
console.error(uniI18n.__('pluginHbuilderx.plaseHXCompileAppPlatform'))
|
|
22
23
|
process.exit(0)
|
|
23
24
|
}
|
|
24
25
|
}
|
|
@@ -36,4 +37,4 @@ module.exports = (api, options) => { // 仅处理 app-plus 相关逻辑
|
|
|
36
37
|
plugins
|
|
37
38
|
}
|
|
38
39
|
})
|
|
39
|
-
}
|
|
40
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcloudio/vue-cli-plugin-hbuilderx",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-32920210926001",
|
|
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": "5e7404fe087c97dfc46bfa7b0ab9044a2fa90142"
|
|
22
22
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const fs = require('fs')
|
|
2
2
|
const path = require('path')
|
|
3
|
+
const uniI18n = require('@dcloudio/uni-cli-i18n')
|
|
3
4
|
|
|
4
5
|
const {
|
|
5
6
|
log,
|
|
@@ -19,7 +20,7 @@ let isFirst = true
|
|
|
19
20
|
let compiling = false
|
|
20
21
|
class WebpackAppPlusPlugin {
|
|
21
22
|
apply (compiler) {
|
|
22
|
-
if (process.env.UNI_USING_V3) {
|
|
23
|
+
if (process.env.UNI_USING_V3) {
|
|
23
24
|
const chunkVersions = {}
|
|
24
25
|
|
|
25
26
|
const entry = compiler.options.entry()
|
|
@@ -31,7 +32,7 @@ class WebpackAppPlusPlugin {
|
|
|
31
32
|
compiler.hooks.invalid.tap('WebpackAppPlusPlugin', (fileName, changeTime) => {
|
|
32
33
|
if (!compiling) {
|
|
33
34
|
compiling = true
|
|
34
|
-
console.log('
|
|
35
|
+
console.log(uniI18n.__('performingHotReload'))
|
|
35
36
|
}
|
|
36
37
|
})
|
|
37
38
|
|
|
@@ -100,7 +101,7 @@ class WebpackAppPlusPlugin {
|
|
|
100
101
|
})
|
|
101
102
|
} else {
|
|
102
103
|
compiler.hooks.done.tapPromise('WebpackAppPlusPlugin', compilation => {
|
|
103
|
-
return new Promise((resolve, reject) => {
|
|
104
|
+
return new Promise((resolve, reject) => {
|
|
104
105
|
if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
|
|
105
106
|
return resolve()
|
|
106
107
|
}
|
|
@@ -137,4 +138,4 @@ class WebpackAppPlusPlugin {
|
|
|
137
138
|
}
|
|
138
139
|
}
|
|
139
140
|
|
|
140
|
-
module.exports = WebpackAppPlusPlugin
|
|
141
|
+
module.exports = WebpackAppPlusPlugin
|
|
@@ -7,6 +7,7 @@ module.exports = function (content, map) {
|
|
|
7
7
|
this.cacheable && this.cacheable()
|
|
8
8
|
this.callback(null, 'module.exports = ' + genStyleString(content, this), map)
|
|
9
9
|
}
|
|
10
|
+
const uniI18n = require('@dcloudio/uni-cli-i18n')
|
|
10
11
|
|
|
11
12
|
// @todo:
|
|
12
13
|
// font-relative lengths: em, ex, ch, ic
|
|
@@ -52,9 +53,7 @@ function genStyleString (input, loader) {
|
|
|
52
53
|
})
|
|
53
54
|
if (msgs.length) {
|
|
54
55
|
if (isFirst) {
|
|
55
|
-
msgs.unshift(
|
|
56
|
-
'nvue中不支持如下css。如全局或公共样式受影响,建议将告警样式写在ifndef APP-PLUS-NVUE的条件编译中,详情如下:'
|
|
57
|
-
)
|
|
56
|
+
msgs.unshift(uniI18n.__('pluginHbuilderx.nvueCssWarning'))
|
|
58
57
|
isFirst = false
|
|
59
58
|
}
|
|
60
59
|
msgs.forEach(msg => console.warn(msg))
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
const uniI18n = require('@dcloudio/uni-cli-i18n')
|
|
2
3
|
|
|
3
4
|
// TODO 暂时处理安装目录包含特殊符号,导致 H5 预览资源加载失败的问题。
|
|
4
5
|
const matchSymbol = __dirname.match(/[()]/)
|
|
5
6
|
if (matchSymbol) {
|
|
6
|
-
console.error(
|
|
7
|
+
console.error(uniI18n.__('pluginHbuilderx.hxBuildFailed', { "0": matchSymbol[0] }))
|
|
7
8
|
process.exit(0)
|
|
8
9
|
}
|
|
9
10
|
|
|
@@ -22,10 +23,10 @@ process.env.UNI_OUTPUT_DIR = path.resolve(process.env.UNI_OUTPUT_DIR)
|
|
|
22
23
|
const service = new Service(process.env.VUE_CLI_CONTEXT || process.cwd())
|
|
23
24
|
|
|
24
25
|
service.run((process.env.NODE_ENV === 'development' && process.env.UNI_PLATFORM === 'h5') ? 'uni-serve' : 'uni-build', {
|
|
25
|
-
watch: process.env.NODE_ENV === 'development',
|
|
26
|
+
watch: process.env.NODE_ENV === 'development',
|
|
26
27
|
minimize: process.env.UNI_MINIMIZE === 'true',
|
|
27
28
|
clean: false
|
|
28
29
|
}).catch(err => {
|
|
29
30
|
error(err)
|
|
30
31
|
process.exit(1)
|
|
31
|
-
})
|
|
32
|
+
})
|