vue.config.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. const { defineConfig } = require("@vue/cli-service")
  2. module.exports = defineConfig({
  3. transpileDependencies: true,
  4. productionSourceMap: false,
  5. css: {
  6. loaderOptions: {
  7. //全局变量
  8. sass: {
  9. additionalData: `@use "@/assets/variables.scss" as *;`
  10. },
  11. postcss: {
  12. postcssOptions: {
  13. plugins: [
  14. require("postcss-pxtorem")({
  15. rootValue: 18, // 换算的基数
  16. selectorBlackList: ["-nopx"], // 忽略转换正则匹配项 列入一些ui库, ['.el'] 就是忽略elementUI库
  17. propList: ["*"],
  18. exclude: file => {
  19. if (file.includes("coursewarePlay")) {
  20. return true
  21. }
  22. if (file.includes("globalTools")) {
  23. return true
  24. }
  25. if (file.includes("normalize")) {
  26. return true
  27. }
  28. return false
  29. }
  30. })
  31. ]
  32. }
  33. }
  34. }
  35. },
  36. devServer: {
  37. proxy: {
  38. "/gym": {
  39. target: "https://dev.gym.lexiaoya.cn",
  40. pathRewrite: {
  41. "^/gym": ""
  42. }
  43. },
  44. "/gyt": {
  45. target: "https://dev.lexiaoya.cn",
  46. pathRewrite: {
  47. "^/gyt": ""
  48. }
  49. },
  50. "/klx": {
  51. target: "https://dev.colexiu.com",
  52. pathRewrite: {
  53. "^/klx": ""
  54. }
  55. }
  56. }
  57. }
  58. })