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
2.99k stars 401 forks source link

exclude选项在windows无效的问题 #86

Open maYunLaoXi opened 3 years ago

maYunLaoXi commented 3 years ago

代码都是一样的,装的postcss版本也是一样,windows系统下进行了转换,而mac ,linux下不会。版本v1.1.1。 环境:vue-cli4的scss项目。配置于postcss.config.js

exclude option is used at macOs and linux but windows.

/ px-to-viewport-ignore-next / and / px-to-viewport-ignore / useless in all sys.

postcss.config.js: exclude: [/node_modules/, /src\/styles\/stillPx/], .qrcode-box, .qrcode{ height: 364px; } windows: yvcpfU.png

mac/lunix: yvca9S.png

zimutao commented 3 years ago

解决了吗?

wxwxnzm commented 3 years ago

解决了吗?

/src\/styles\/stillPx/, /src\styles\stillPx/

maYunLaoXi commented 3 years ago

解决了吗?

还没有,目前用了大写的PX的方法先用着

lovewenzi commented 2 years ago

解决了吗?

还没有,目前用了大写的PX的方法先用着

这个大写的px给我整笑了。我也遇到类似的问题

HobaiRiku commented 2 years ago

解决了吗?

还没有,目前用了大写的PX的方法先用着

目前发现不管注释还是exclude都不行,也是看到大佬用PX先用着哈哈哈

liuyan0535 commented 2 years ago

路径解析的问题吧。这样写: /src[/|\\]styles[/|\\]stillPx/

bossikill commented 2 years ago

路径解析的问题吧。这样写: /src[/|\]styles[/|\]stillPx/

牛啊 亲测可用

maYunLaoXi commented 2 years ago

总结网友的方法:

  1. 使用大写的PX代替小写的px从而跳过转换
  2. windows电脑路径的问题,修改正则,例如本例改成:/src[/|\]styles[/|\]stillPx/
  3. 参考这个pr: #62
xiao-Yu53 commented 1 year ago

exclude: /src[/|\]views[/|\]modules/, 为什么我写成这种也不生效呢

xiao-Yu53 commented 1 year ago

路径解析的问题吧。这样写: /src[/|]styles[/|]stillPx/

牛啊 亲测可用

我的怎么不行啊~~~~