@mpxjs/webpack-plugin 2.9.31 → 2.9.32
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/lib/loader.js
CHANGED
|
@@ -83,7 +83,7 @@ module.exports = function (content) {
|
|
|
83
83
|
const loaderContext = this
|
|
84
84
|
const isProduction = this.minimize || process.env.NODE_ENV === 'production'
|
|
85
85
|
const filePath = this.resourcePath
|
|
86
|
-
const moduleId = ctorType === 'app' ? MPX_APP_MODULE_ID : mpx.pathHash(filePath)
|
|
86
|
+
const moduleId = ctorType === 'app' ? MPX_APP_MODULE_ID : '_' + mpx.pathHash(filePath)
|
|
87
87
|
|
|
88
88
|
const parts = parseComponent(content, {
|
|
89
89
|
filePath,
|
package/lib/native-loader.js
CHANGED
|
@@ -188,7 +188,7 @@ module.exports = function (content) {
|
|
|
188
188
|
if (appName) this._module.addPresentationalDependency(new AppEntryDependency(resourcePath, appName))
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
const moduleId = ctorType === 'app' ? MPX_APP_MODULE_ID : mpx.pathHash(filePath)
|
|
191
|
+
const moduleId = ctorType === 'app' ? MPX_APP_MODULE_ID : '_' + mpx.pathHash(filePath)
|
|
192
192
|
|
|
193
193
|
if (ctorType !== 'app') {
|
|
194
194
|
rulesRunnerOptions.mainKey = pagesMap[resourcePath] ? 'page' : 'component'
|
|
@@ -15,7 +15,7 @@ module.exports = function (css, map) {
|
|
|
15
15
|
const cb = this.async()
|
|
16
16
|
const { resourcePath, queryObj } = parseRequest(this.resource)
|
|
17
17
|
const mpx = this.getMpx()
|
|
18
|
-
const id = queryObj.moduleId || queryObj.mid || mpx.pathHash(resourcePath)
|
|
18
|
+
const id = queryObj.moduleId || queryObj.mid || '_' + mpx.pathHash(resourcePath)
|
|
19
19
|
const appInfo = mpx.appInfo
|
|
20
20
|
const defs = mpx.defs
|
|
21
21
|
const mode = mpx.mode
|
|
@@ -1878,9 +1878,11 @@ function getVirtualHostRoot (options, meta) {
|
|
|
1878
1878
|
function processShow (el, options, root) {
|
|
1879
1879
|
// 开启 virtualhost 全部走 props 传递处理
|
|
1880
1880
|
// 未开启 virtualhost 直接绑定 display:none 到节点上
|
|
1881
|
-
let show = getAndRemoveAttr(el, config[mode].directive.show)
|
|
1881
|
+
let { val: show, has } = getAndRemoveAttr(el, config[mode].directive.show)
|
|
1882
1882
|
if (mode === 'swan') show = wrapMustache(show)
|
|
1883
|
-
|
|
1883
|
+
if (has && show === undefined) {
|
|
1884
|
+
error$1(`Attrs ${config[mode].directive.show} should have a value `)
|
|
1885
|
+
}
|
|
1884
1886
|
if (options.hasVirtualHost) {
|
|
1885
1887
|
if (options.isComponent && el.parent === root && isRealNode(el)) {
|
|
1886
1888
|
if (show !== undefined) {
|
|
@@ -1911,7 +1913,7 @@ function processShow (el, options, root) {
|
|
|
1911
1913
|
oldStyle = oldStyle ? oldStyle + ';' : ''
|
|
1912
1914
|
addAttrs(el, [{
|
|
1913
1915
|
name: 'style',
|
|
1914
|
-
value: `${oldStyle}{{${showExp}
|
|
1916
|
+
value: `${oldStyle}{{${showExp}?'':'display:none;'}}`
|
|
1915
1917
|
}])
|
|
1916
1918
|
}
|
|
1917
1919
|
}
|
|
@@ -27,7 +27,7 @@ module.exports = function (raw) {
|
|
|
27
27
|
const hasComment = queryObj.hasComment
|
|
28
28
|
const isNative = queryObj.isNative
|
|
29
29
|
const hasScoped = queryObj.hasScoped
|
|
30
|
-
const moduleId = queryObj.moduleId || mpx.pathHash(resourcePath)
|
|
30
|
+
const moduleId = queryObj.moduleId || '_' + mpx.pathHash(resourcePath)
|
|
31
31
|
|
|
32
32
|
let optimizeRenderLevel = 0
|
|
33
33
|
for (const rule of optimizeRenderRules) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpxjs/webpack-plugin",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.32",
|
|
4
4
|
"description": "mpx compile core",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mpx"
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"engines": {
|
|
83
83
|
"node": ">=14.14.0"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "61ac5a85a2b75304d8b989d4291b4f606f50d82f"
|
|
86
86
|
}
|