2
0

vue.config.js 1.7 KB

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