postcss.config.js 1.3 KB

123456789101112131415161718192021222324
  1. module.exports = {
  2. plugins: {
  3. 'autoprefixer': {},
  4. "postcss-px-to-viewport": {
  5. viewportWidth: 750, // (Number) The width of the viewport. 750, 375
  6. // viewportHeight: 1334, // (Number) The height of the viewport.
  7. viewportHeight: 1624, // (Number) The height of the viewport.
  8. unitPrecision: 3, // (Number) The decimal numbers to allow the REM units to grow to.
  9. viewportUnit: 'vw', // (String) Expected units.
  10. selectorBlackList: ['.ignore', '.hairlines'], // (Array) The selectors to ignore and leave as px.
  11. minPixelValue: 1, // (Number) Set the minimum pixel value to replace.
  12. mediaQuery: false, // (Boolean) Allow px to be converted in media queries.
  13. exclude: [
  14. /node_modules/,
  15. // /src\/kui\/components\/k-tab/,
  16. /src\/kui\/components\/k-illustration/,
  17. ], // 设置忽略文件,用正则做目录名匹配
  18. // exclude: [/node_modules/, /src\/kui/], // 设置忽略文件,用正则做目录名匹配
  19. landscape: false, // 是否处理横屏情况
  20. propList: ["*"], // 指定转换的css属性的单位,*代表全部css属性的单位都进行转换
  21. },
  22. }
  23. }