postcss.config.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. exports.postfactory = function (opts) {
  2. // console.log(111111);
  3. return [
  4. //css中引入内联样式表
  5. // require('postcss-easy-import')(),
  6. //css混合宏的使用
  7. require('postcss-mixins')(),
  8. //css的for循环插件 必须在postcss-simple-vars之前运行
  9. require('postcss-for')(),
  10. require('postcss-each')(),
  11. //类似于sass语法的css变量定义
  12. require('postcss-simple-vars')({
  13. variables:{
  14. "main-color":"#d15050",
  15. }
  16. }),
  17. //sass扩展语法
  18. require('postcss-sass-extend')(),
  19. //css媒体查询简写 https://github.com/postcss/postcss-media-minmax/blob/master/README-zh.md
  20. // require('postcss-media-minmax')(),
  21. //css层级写法 https://github.com/postcss/postcss-nested
  22. require('postcss-nested')(),
  23. //css选择器简写
  24. require('postcss-selector-matches')(),
  25. require('postcss-selector-not')(),
  26. //css缩写与简写 crip的缩写列表 https://github.com/johnie/crip-css-properties
  27. require('postcss-alias')(),
  28. require('postcss-crip')(),
  29. //css浏览器兼容(vue已内置)
  30. // require('autoprefixer')({ browsers: ['last 2 versions'] }),
  31. //css计算
  32. require("postcss-calc")
  33. ];
  34. }