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.07k stars 405 forks source link

How to configure include #57

Open meiqinLiu opened 4 years ago

meiqinLiu commented 4 years ago

Can you write an example of include? How do you write it? I downloaded the above case of GitHub and failed to configure include

meiqinLiu commented 4 years ago

I tested it In this way, it works

meiqinLiu commented 4 years ago

module.exports = { plugins: { 'postcss-px-to-viewport': { viewportWidth: 750, // 设计稿的视口宽度 minPixelValue: 1, // 设置最小的转换数值,如果为1的话,只有大于1的值会被转换 exclude: [/node_modules/], include: [/mobile/] } } }