@mpxjs/webpack-plugin 2.8.61 → 2.8.62
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/platform/json/wx/index.js +3 -3
- package/lib/platform/template/wx/component-config/fix-html-tag.js +2 -2
- package/lib/runtime/components/web/mpx-movable-view.vue +6 -1
- package/lib/runtime/components/web/mpx-scroll-view.vue +6 -1
- package/lib/runtime/components/web/mpx-swiper.vue +6 -1
- package/lib/utils/dom-tag-config.js +14 -0
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@ const normalizeTest = require('../normalize-test')
|
|
|
3
3
|
const changeKey = require('../change-key')
|
|
4
4
|
const normalize = require('../../../utils/normalize')
|
|
5
5
|
const { capitalToHyphen } = require('../../../utils/string')
|
|
6
|
-
const { isOriginTag } = require('../../../utils/dom-tag-config')
|
|
6
|
+
const { isOriginTag, isBuildInTag } = require('../../../utils/dom-tag-config')
|
|
7
7
|
|
|
8
8
|
const mpxViewPath = normalize.lib('runtime/components/ali/mpx-view.mpx')
|
|
9
9
|
const mpxTextPath = normalize.lib('runtime/components/ali/mpx-text.mpx')
|
|
@@ -127,7 +127,7 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
|
-
* 将小程序代码中使用的与原生 HTML tag
|
|
130
|
+
* 将小程序代码中使用的与原生 HTML tag 或 内建组件 同名的组件进行转化,以解决与原生tag命名冲突问题。
|
|
131
131
|
* @param {string} type usingComponents
|
|
132
132
|
* @returns input
|
|
133
133
|
*/
|
|
@@ -136,7 +136,7 @@ module.exports = function getSpec ({ warn, error }) {
|
|
|
136
136
|
const usingComponents = input[type]
|
|
137
137
|
if (usingComponents) {
|
|
138
138
|
Object.keys(usingComponents).forEach(tag => {
|
|
139
|
-
if (isOriginTag(tag)) {
|
|
139
|
+
if (isOriginTag(tag) || isBuildInTag(tag)) {
|
|
140
140
|
usingComponents[`mpx-com-${tag}`] = usingComponents[tag]
|
|
141
141
|
delete usingComponents[tag]
|
|
142
142
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const { isOriginTag } = require('../../../../utils/dom-tag-config')
|
|
1
|
+
const { isOriginTag, isBuildInTag } = require('../../../../utils/dom-tag-config')
|
|
2
2
|
|
|
3
3
|
module.exports = function () {
|
|
4
4
|
return {
|
|
5
5
|
waterfall: true,
|
|
6
|
-
test: (input) => isOriginTag(input),
|
|
6
|
+
test: (input) => isOriginTag(input) || isBuildInTag(input),
|
|
7
7
|
// 处理原生tag
|
|
8
8
|
web (tag, data = {}) {
|
|
9
9
|
// @see packages/webpack-plugin/lib/platform/json/wx/index.js webHTMLTagProcesser
|
|
@@ -68,6 +68,19 @@ const isNativeMiniTag = makeMap(
|
|
|
68
68
|
'open-data,native-component,aria-component,page-meta'
|
|
69
69
|
)
|
|
70
70
|
|
|
71
|
+
/**
|
|
72
|
+
* 是否为mpx内置组件
|
|
73
|
+
* collected from packages/webpack-plugin/lib/runtime/components/web/
|
|
74
|
+
*/
|
|
75
|
+
const isBuildInTag = makeMap(
|
|
76
|
+
'mpx-image,mpx-picker-view,mpx-slider,mpx-textarea,mpx-input,mpx-picker,' +
|
|
77
|
+
'mpx-swiper-item,mpx-video,mpx-button,mpx-keep-alive,mpx-progress,' +
|
|
78
|
+
'mpx-swiper,mpx-view,mpx-checkbox-group,mpx-movable-area,mpx-radio-group,' +
|
|
79
|
+
'mpx-switch,mpx-web-view,mpx-checkbox,mpx-movable-view,mpx-radio,' +
|
|
80
|
+
'mpx-tab-bar-container,mpx-form,mpx-navigator,mpx-rich-text,mpx-tab-bar,' +
|
|
81
|
+
'mpx-icon,mpx-picker-view-column,mpx-scroll-view,mpx-text'
|
|
82
|
+
)
|
|
83
|
+
|
|
71
84
|
const isSpace = makeMap('ensp,emsp,nbsp')
|
|
72
85
|
|
|
73
86
|
const isContWidth = makeMap('col,colgroup,img,table,td,th,tr')
|
|
@@ -92,6 +105,7 @@ module.exports = {
|
|
|
92
105
|
isVoidTag,
|
|
93
106
|
isNonPhrasingTag,
|
|
94
107
|
isRichTextTag,
|
|
108
|
+
isBuildInTag,
|
|
95
109
|
isUnaryTag,
|
|
96
110
|
isSpace,
|
|
97
111
|
isContWidth,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpxjs/webpack-plugin",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.62",
|
|
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": "968ecb02c86fcd5e9f8f827645907ea4225266ff"
|
|
86
86
|
}
|