evrone / postcss-px-to-viewport

A plugin for PostCSS that generates viewport units (vw, vh, vmin, vmax) from pixel units. The best choice to create a scalable interface on different displays by one design size.
https://evrone.com/postcss-px-viewport
MIT License
3.04k stars 406 forks source link

在package中配置 exclude 检测失败 #68

Open tudou0099 opened 4 years ago

tudou0099 commented 4 years ago

Object.prototype.toString.call(reg) !== '[object RegExp]' 这个地方会认为reg为string

tudou0099 commented 4 years ago
"postcss": {
    "plugins": {
      "postcss-import": {},
      "postcss-url": {},
      "postcss-aspect-ratio-mini": {},
      "postcss-cssnext": {},
      "postcss-px-to-viewport": {
        "viewportWidth": 375,
        "unitPrecision": 3,
        "viewportUnit": "vw",
        "selectorBlackList": [
          ".ignore",
          ".hairlines"
        ],
        "exclude": [
          "/node_modules/"
        ],
        "minPixelValue": 1,
        "mediaQuery": false
      },
      "cssnano": {
        "autoprefixer": false,
        "zindex": false
      }
    }
  },
diuqilei commented 3 years ago

@tudou0099

exclude: [/(\/|\\)node_modules(\/|\\)/]
tudou0099 commented 3 years ago

@tudou0099

exclude: [/(\/|\\)node_modules(\/|\\)/]

我使用的是vue cli3 配置放在package.json中 没有采用单独的配置文件 你这种是可以放在单独配置文件中的