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

include设置无效 #53

Closed 1870390731 closed 3 years ago

1870390731 commented 4 years ago

"postcss-px-to-viewport": { "viewportWidth": 375, "minPixelValue": 1, include: [path.resolve('src/views/mobile')] } 这样设置以后,views下面的web文件夹下面的所有vue文件还是转换成了vw,请问下这是什么原因?

starlight02 commented 4 years ago
  • include (Array or Regexp) 如果设置了include,那将只有匹配到的文件才会被转换,例如只转换 'src/mobile' 下的文件 (include: /\/src\/mobile\//)
    • 如果值是一个正则表达式,将包含匹配的文件,否则将排除该文件
    • 如果传入的值是一个数组,那么数组里的值必须为正则

include 必须是正则表达式,但是问题是,我按文档上设置的 include: /\/src\/mobile\// 也无效,有人知道怎么回事吗?

1870390731 commented 4 years ago
  • include (Array or Regexp) 如果设置了include,那将只有匹配到的文件才会被转换,例如只转换 'src/mobile' 下的文件 (include: /\/src\/mobile\//)

    • 如果值是一个正则表达式,将包含匹配的文件,否则将排除该文件
    • 如果传入的值是一个数组,那么数组里的值必须为正则

include 必须是正则表达式,但是问题是,我按文档上设置的 include: /\/src\/mobile\// 也无效,有人知道怎么回事吗?

我也是按文档上设置无效

IceApriler commented 4 years ago

Hey, you can use the github repository code and switch to NPM after the NPM package is released.

嗨,你们可以先使用github仓库的代码,等npm包发布后再切换到npm。

npm i https://github.com/evrone/postcss-px-to-viewport --save-dev
starlight02 commented 4 years ago

Hey, you can use the github repository code and switch to NPM after the NPM package is released.

嗨,你们可以先使用github仓库的代码,等npm包发布后再切换到npm。

npm i https://github.com/evrone/postcss-px-to-viewport --save-dev

感谢提供解决方案!

Thank you for providing the solution.

mqhe2007 commented 4 years ago

include 是上个月才做的,还没有 release,但是文档已经提前更新了,太坑了。。。

包括忽略的注释语法,包不发就更新文档,太误导人了。

viphsx123 commented 3 years ago

还没发包到npm吗

git-lt commented 3 years ago

不兼容windows环境的下路径,path需要处理一下

1870390731 commented 3 years ago

还没发包到npm吗

刚试了下,还是不行

younth commented 3 years ago

为啥不发npm啊....

codetwl commented 3 years ago

image 明明设置了按照类屏蔽不转化为px,无效

xiaofan9 commented 3 years ago

image 好像这样设置,依旧无效,懵逼了

MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM commented 3 years ago

include的 还没发包嘛,设置完了 还是不好使啊 …………………………………………………………

xiaofan9 commented 3 years ago

include的 还没发包嘛,设置完了 还是不好使啊 …………………………………………………………

还没有。一直卡着

chaos-zhu commented 3 years ago

em...为啥不发,大佬还在过年吗😂

flyyuan commented 3 years ago

到现在还没发....

niefangfang commented 3 years ago

好像这样设置,依旧无效,懵逼了

你的设置好了吗,为啥我的用了 npm i https://github.com/evrone/postcss-px-to-viewport --save-dev 还是不好

lsc9 commented 2 years ago

file path is below:

'D:\\Web_data\\Web_project\\mico_code\\yoho-mobile\\src\\pages\\salaryWithdraw\\withdraw\\pages\\withdraw_home\\index.vue'

so regexp must be like below:

include:[
    /node_modules[\\/]vant[\\/]/,
    /[\\/]src[\\/]pages[\\/]salaryWithdraw[\\/]/
]

/\/src\/pages\/salaryWithdraw/ is bad.

usercao commented 2 years ago

今天为止还是没发😅

winjeysong commented 2 years ago

因为原作者迟迟不发布,所以我fork了一份,发布了一个包含 include 配置的包:postcss-px-to-viewport-update,大家可以在原作者release之后再换回来。

hi guys, i forked this repo & published a package with include - postcss-px-to-viewport-update. you can use this one until this repo releases a new version.

guikuan commented 2 years ago

因为原作者迟迟不发布,所以我fork了一份,发布了一个包含 include 配置的包:postcss-px-to-viewport-update,大家可以在原作者release之后再换回来。

hi guys, i forked this repo & published a package with include - postcss-px-to-viewport-update. you can use this one until this repo releases a new version.

太感谢了,很好用,敏感肌也能用🤲

wenmua commented 2 years ago

这都一年半了吧....大佬 还没更新处理 include 的问题吗

qidasheng369 commented 2 years ago

是不是大佬太忙了?把这茬事给忘了吗

bailuochen commented 2 years ago

看来是忘记了

bailuochen commented 2 years ago

因为原作者迟迟不发布,所以我fork了一份,发布了一个包含 include 配置的包:postcss-px-to-viewport-update,大家可以在原作者release之后再换回来。

hi guys, i forked this repo & published a package with include - postcss-px-to-viewport-update. you can use this one until this repo releases a new version.

感谢🙏,把之前安装的postcss-px-to-viewport卸载后,安装这个非常好用。

xiang1128 commented 2 years ago

作者已经去世了吗 这么久不更新

lzm0x219 commented 2 years ago

作者已经去世了吗 这么久不更新

你以为你很幽默吗?🙄

xiang1128 commented 2 years ago

这么久没有更新

你以为你很幽默吗?🙄

我是认真的

chaos-zhu commented 2 years ago

这么久没有更新

你以为你很幽默吗?🙄

我是认真的

上面不是有人发了吗,还这么咒人......

doerme commented 1 year ago

4年没更新了 4 years no update

ranran310 commented 6 months ago

postcss-px-to-viewport插件已弃用,使用postcss-px-to-viewport-8-plugin代替

pandaXiong01 commented 4 months ago

发了npm包支持 include @pandaxiong1992/postcss-px-to-viewport this npm package support include

ELing-Lonely commented 4 months ago

现在还有更新,虽然发布了postcss-px-to-viewport-8-plugin 但是我这个项目由一些其他的冲突了啊啊啊