Skip to content

Commit

Permalink
add -webkit-flex
Browse files Browse the repository at this point in the history
  • Loading branch information
huajingwen@didiglobal.com committed May 15, 2024
1 parent baf2031 commit 3af95b6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 10 additions & 10 deletions packages/webpack-plugin/lib/platform/style/wx/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ module.exports = function getSpec ({ warn, error }) {
}
}

// 需要过滤的属性返回value=false
const needDelProps = ({ prop }) => {
return { prop, value: false }
}
// // 需要过滤的属性返回value=false
// const needDelProps = ({ prop }) => {
// return { prop, value: false }
// }

const spec = {
supportedModes: ['ios', 'android'],
Expand Down Expand Up @@ -263,12 +263,12 @@ module.exports = function getSpec ({ warn, error }) {
ios: formatBoxReviation,
android: formatBoxReviation
},
// 需要过滤的属性返回value=false Todo value 校验
{
test: /^-(webkit|moz|ms|o)-/,
ios: needDelProps,
android: needDelProps
},
// // 需要过滤的属性返回value=false
// {
// test: /^-(webkit|moz|ms|o)-/,
// ios: needDelProps,
// android: needDelProps
// },
// 通用的简写格式匹配
{
test: new RegExp('^(' + Object.keys(AbbreviationMap).join('|') + ')$'),
Expand Down
2 changes: 2 additions & 0 deletions packages/webpack-plugin/lib/react/style-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const getRulesRunner = require('../platform/index')
const dash2hump = require('../utils/hump-dash').dash2hump
const rpxRegExp = /^\s*(\d+(\.\d+)?)rpx\s*$/
const pxRegExp = /^\s*(\d+(\.\d+)?)(px)?\s*$/
const cssPrefixExp = /^-(webkit|moz|ms|o)-/
function getClassMap ({ content, filename, mode, srcMode }) {
const classMap = {}

Expand Down Expand Up @@ -47,6 +48,7 @@ function getClassMap ({ content, filename, mode, srcMode }) {
root.walkRules(rule => {
const classMapValue = {}
rule.walkDecls(({ prop, value }) => {
if (cssPrefixExp.test(prop) || cssPrefixExp.test(value)) return
let newData = rulesRunner({ prop, value })
if (!newData.length) {
newData = [newData]
Expand Down

0 comments on commit 3af95b6

Please sign in to comment.