postcss.config.js 931 B

123456789101112131415161718192021
  1. module.exports = ({ file, options, env }) => {
  2. const pluginsConfig = {
  3. autoprefixer: {}
  4. };
  5. if(process.env.PROJECT_CLIENT === 'mobile') {
  6. pluginsConfig["postcss-px-to-viewport"] = {
  7. viewportWidth: 350, // (Number) The width of the viewport.
  8. viewportHeight: 1334, // (Number) The height of the viewport.
  9. unitPrecision: 3, // (Number) The decimal numbers to allow the REM units to grow to.
  10. viewportUnit: 'vmin', // (String) Expected units.
  11. fontViewportUnit: 'vmin',
  12. exclude: [],
  13. selectorBlackList: ['.ignore', '.hairlines'], // (Array) The selectors to ignore and leave as px.
  14. minPixelValue: 1, // (Number) Set the minimum pixel value to replace.
  15. mediaQuery: false // (Boolean) Allow px to be converted in media queries.
  16. };
  17. }
  18. return {
  19. plugins: pluginsConfig
  20. };
  21. };