postcss-pxtransform 4.0.10-beta.1 → 4.0.10-beta.3

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.
Files changed (2) hide show
  1. package/index.js +6 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -235,11 +235,13 @@ module.exports = (options = {}) => {
235
235
  },
236
236
  AtRule: {
237
237
  media: (rule) => {
238
- if (skip) return
239
- if (!opts.methods.includes('size')) return
238
+ if (opts.mediaQuery) {
239
+ if (skip) return
240
+ if (!opts.methods.includes('size')) return
240
241
 
241
- if (!/px/i.test(rule.params)) return
242
- rule.params = rule.params.replace(pxRgx, pxReplace)
242
+ if (!/px/i.test(rule.params)) return
243
+ rule.params = rule.params.replace(pxRgx, pxReplace)
244
+ }
243
245
  },
244
246
  },
245
247
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss-pxtransform",
3
- "version": "4.0.10-beta.1",
3
+ "version": "4.0.10-beta.3",
4
4
  "description": "PostCSS plugin px 转小程序 rpx及h5 rem 单位",
5
5
  "author": "O2Team",
6
6
  "license": "MIT",