@mpxjs/webpack-plugin 2.8.46 → 2.8.47

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.
@@ -193,14 +193,7 @@ module.exports = function getSpec ({ warn, error }) {
193
193
  // 不过滤的话每一个属性都要 parse
194
194
  el.attrsList.filter(item => this.test.test(item.name)).forEach((item) => {
195
195
  const parsed = parseMustache(item.value)
196
- if (item.name === 'wx:style') {
197
- styleBinding.push(parsed.result)
198
- // item.name === 'style'
199
- } else if (parsed.hasBinding || parsed.result.indexOf('rpx') > -1) {
200
- styleBinding.push(parsed.result)
201
- } else {
202
- styleBinding.push(JSON.stringify(item.value))
203
- }
196
+ styleBinding.push(parsed.result)
204
197
  })
205
198
  return {
206
199
  name: ':style',
@@ -878,6 +878,7 @@ function moveBaseDirective (target, from, isDelete = true) {
878
878
  }
879
879
 
880
880
  function stringify (str) {
881
+ if (mode === 'web') str = str.replace(/'/g, '"')
881
882
  return JSON.stringify(str)
882
883
  }
883
884
 
@@ -988,7 +989,7 @@ function parseFuncStr2 (str) {
988
989
  if (subIndex) {
989
990
  const index1 = ret.index + subIndex
990
991
  const index2 = index1 + 6
991
- args = args.substring(0, index1) + JSON.stringify(eventIdentifier) + args.substring(index2)
992
+ args = args.substring(0, index1) + stringify(eventIdentifier) + args.substring(index2)
992
993
  }
993
994
  }
994
995
  return {
@@ -1016,7 +1017,7 @@ function stringifyWithResolveComputed (modelValue) {
1016
1017
  computedStack.push(char)
1017
1018
  if (computedStack.length === 1) {
1018
1019
  fragment += '.'
1019
- result.push(JSON.stringify(fragment))
1020
+ result.push(stringify(fragment))
1020
1021
  fragment = ''
1021
1022
  continue
1022
1023
  }
@@ -1033,7 +1034,7 @@ function stringifyWithResolveComputed (modelValue) {
1033
1034
  fragment += char
1034
1035
  }
1035
1036
  if (fragment !== '') {
1036
- result.push(JSON.stringify(fragment))
1037
+ result.push(stringify(fragment))
1037
1038
  }
1038
1039
  return result.join('+')
1039
1040
  }
@@ -1696,7 +1697,7 @@ function processWebExternalClassesHack (el, options) {
1696
1697
  options.externalClasses.forEach((className) => {
1697
1698
  const index = classNames.indexOf(className)
1698
1699
  if (index > -1) {
1699
- replacements.push(`$attrs[${JSON.stringify(className)}]`)
1700
+ replacements.push(`$attrs[${stringify(className)}]`)
1700
1701
  classNames.splice(index, 1)
1701
1702
  }
1702
1703
  })
@@ -1730,13 +1731,13 @@ function processWebExternalClassesHack (el, options) {
1730
1731
  options.externalClasses.forEach((className) => {
1731
1732
  const index = classNames.indexOf(className)
1732
1733
  if (index > -1) {
1733
- replacements.push(`$attrs[${JSON.stringify(className)}]`)
1734
+ replacements.push(`$attrs[${stringify(className)}]`)
1734
1735
  classNames.splice(index, 1)
1735
1736
  }
1736
1737
  })
1737
1738
 
1738
1739
  if (classNames.length) {
1739
- replacements.unshift(JSON.stringify(classNames.join(' ')))
1740
+ replacements.unshift(stringify(classNames.join(' ')))
1740
1741
  }
1741
1742
 
1742
1743
  addAttrs(el, [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mpxjs/webpack-plugin",
3
- "version": "2.8.46",
3
+ "version": "2.8.47",
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": "dcf6f000660d56207ff414cb776e8bc6d5ce651f"
85
+ "gitHead": "9069d7f3931841a7e3acaf990464813a3b6ccb0c"
86
86
  }