// 使用 @vue/cli autoprefixer 依赖,如使用严格包管理模式需要兼容处理 const autoprefixer = require('autoprefixer') const pxtoviewport = require('@jonny1994/postcss-px-to-viewport') // const envBook = process.argv.includes('config/storybook') const envBook = false let plugins = [] if (!envBook) { plugins = [ autoprefixer, pxtoviewport({ unitToConvert: 'px', viewportWidth: 375, unitPrecision: 3, propList: ['*'], viewportUnit: 'vw', fontViewportUnit: 'vw', selectorBlackList: [], // 小于或等于 1px 的像素值不进行转换 minPixelValue: 1, mediaQuery: false, // 兼容 vant 需要去掉此处 // exclude: [/node_modules/], replace: true }) ] } module.exports = { plugins }