postcss-pxtransform 3.7.0-alpha.2 → 3.7.0-alpha.20

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 +5 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -40,7 +40,7 @@ let targetUnit
40
40
 
41
41
  module.exports = (options = {}) => {
42
42
  options = Object.assign({}, DEFAULT_WEAPP_OPTIONS, options)
43
-
43
+ const exclude = options.exclude
44
44
  const transUnits = ['px']
45
45
  const baseFontSize = options.baseFontSize || (options.minRootSize >= 1 ? options.minRootSize : 20)
46
46
  const designWidth = (input) =>
@@ -116,6 +116,10 @@ module.exports = (options = {}) => {
116
116
 
117
117
  /** 是否跳过当前文件不处理 */
118
118
  let skip = false
119
+
120
+ if (exclude && exclude?.(result.opts.from)) {
121
+ return null
122
+ }
119
123
 
120
124
  return {
121
125
  // 注意:钩子在节点变动时会重新执行,Once,OnceExit只执行一次,https://github.com/NervJS/taro/issues/13238
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "postcss-pxtransform",
3
- "version": "3.7.0-alpha.2",
3
+ "version": "3.7.0-alpha.20",
4
4
  "description": "PostCSS plugin px 转小程序 rpx及h5 rem 单位",
5
5
  "main": "index.js",
6
6
  "keywords": [