2
0

vue.config.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. const { defineConfig } = require("@vue/cli-service");
  2. module.exports = defineConfig({
  3. transpileDependencies: true,
  4. css: {
  5. loaderOptions: {
  6. less: {
  7. lessOptions: {
  8. javascriptEnabled: true,
  9. modifyVars: {
  10. "primary-color": "#42b883",
  11. "font-color": "#444",
  12. },
  13. },
  14. },
  15. postcss: {
  16. postcssOptions: {
  17. plugins: [
  18. require("autoprefixer")({
  19. overrideBrowserslist: [
  20. "Android 4.1",
  21. "iOS 7.1",
  22. "Chrome > 31",
  23. "ff > 31",
  24. "ie >= 8",
  25. "last 10 versions", // 所有主流浏览器最近10版本用
  26. ],
  27. grid: true,
  28. }),
  29. require("postcss-pxtorem")({
  30. rootValue: 140, //设计稿宽度%10 比如 1920
  31. exclude: /(node_module)/, //默认false,可以(reg)利用正则表达式排除某些文件夹的方法,例如/(node_module|src)/
  32. propList: ["*"], //是一个存储哪些将被转换的属性列表,这里设置为["*"]全部,假设需要仅对边框进行设置,可以写]['*','!border*']
  33. //selectorBlackList :['.box'],//,那例如fs-xl类名,里面有关px的样式将不被转换,这里也支持正则写法。
  34. replace: true, //替换包含rems的规则。
  35. mediaQuery: false, //(布尔值)允许在媒体查询中转换px。
  36. minPixelValue: 0, //设置要替换的最小像素值(3px会被转rem)。 默认 0
  37. }),
  38. ],
  39. },
  40. },
  41. },
  42. },
  43. });