vue.config.js 1.6 KB

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