vue.config.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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("normalize")) {
  23. return true
  24. }
  25. return false
  26. }
  27. })
  28. ]
  29. }
  30. }
  31. }
  32. },
  33. devServer: {
  34. proxy: {
  35. "/gym": {
  36. target: "https://dev.gym.lexiaoya.cn",
  37. pathRewrite: {
  38. "^/gym": ""
  39. }
  40. },
  41. "/gyt": {
  42. target: "https://dev.lexiaoya.cn",
  43. pathRewrite: {
  44. "^/gyt": ""
  45. }
  46. },
  47. "/klx": {
  48. target: "https://dev.colexiu.com",
  49. pathRewrite: {
  50. "^/klx": ""
  51. }
  52. }
  53. }
  54. }
  55. })