25 lines
		
	
	
		
			1022 B
		
	
	
	
		
			JavaScript
		
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			1022 B
		
	
	
	
		
			JavaScript
		
	
	
	
| module.exports = ({ file, options, env }) => {
 | |
|   const pluginsConfig = {
 | |
|     autoprefixer: {}
 | |
|   };
 | |
|   if(process.env.PROJECT_CLIENT === 'mobile') {
 | |
|     pluginsConfig["postcss-px-to-viewport"] = {
 | |
|             viewportWidth: 375,     // (Number) The width of the viewport.
 | |
|             viewportHeight: 667,    // (Number) The height of the viewport.
 | |
|             unitPrecision: 3,       // (Number) The decimal numbers to allow the REM units to grow to.
 | |
|             viewportUnit: 'vw',     // (String) Expected units.
 | |
|             fontViewportUnit: 'vw',
 | |
|             exclude: [],
 | |
|             selectorBlackList: ['.ignore', '.hairlines'],  // (Array) The selectors to ignore and leave as px.
 | |
|             minPixelValue: 1,       // (Number) Set the minimum pixel value to replace.
 | |
|             mediaQuery: false,       // (Boolean) Allow px to be converted in media queries.
 | |
|             landscape: true,
 | |
|             landscapeUnit: 'vw',
 | |
|             landscapeWidth: 667,
 | |
|         };
 | |
|   }
 | |
|   return {
 | |
|     plugins: pluginsConfig
 | |
|   };
 | |
| };
 |