const { defineConfig } = require("@vue/cli-service")
module.exports = defineConfig({
   transpileDependencies: true,
   productionSourceMap: false,
   css: {
      loaderOptions: {
         //全局变量
         sass: {
            additionalData: `@use "@/assets/variables.scss" as *;`
         },
         postcss: {
            postcssOptions: {
               plugins: [
                  require("postcss-pxtorem")({
                     rootValue: 18, // 换算的基数
                     selectorBlackList: ["-nopx"], // 忽略转换正则匹配项 列入一些ui库, ['.el'] 就是忽略elementUI库
                     propList: ["*"],
                     exclude: file => {
                        if (file.includes("coursewarePlay")) {
                           return true
                        }
                        if (file.includes("globalTools")) {
                           return true
                        }
                        if (file.includes("normalize")) {
                           return true
                        }
                        return false
                     }
                  })
               ]
            }
         }
      }
   },
   devServer: {
      proxy: {
         "/gym": {
            target: "https://test.gym.lexiaoya.cn",
            pathRewrite: {
               "^/gym": ""
            }
         },
         "/gyt": {
            target: "https://test.lexiaoya.cn",
            pathRewrite: {
               "^/gyt": ""
            }
         },
         "/klx": {
            target: "https://test.colexiu.com",
            pathRewrite: {
               "^/klx": ""
            }
         }
      }
   }
})
