lkxian888 / postcss-px-to-viewport-8-plugin

解决 postcss-px-to-viewport 控制台输出: postcss.plugin was deprecated. Migration guide:
170 stars 29 forks source link

can not work in vite2.0? #1

Closed ZedCoding closed 1 year ago

ZedCoding commented 2 years ago

image

lkxian888 commented 1 year ago

vite请在vite.config.ts 添加如下代码
import postcsspxtoviewport8plugin from 'postcss-px-to-viewport-8-plugin';

export default defineConfig({ css: { postcss: { plugins: [ postcsspxtoviewport8plugin({ unitToConvert: 'px', viewportWidth: 1920; unitPrecision: 5, propList: ['*'], viewportUnit: 'vw', fontViewportUnit: 'vw', selectorBlackList: [], minPixelValue: 1, mediaQuery: true, replace: true, exclude: [], include: undefined, landscape: false, landscapeUnit: 'vw' }), ], }, }, })