vue.config.js 992 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. const path = require("path");
  2. // const common = path.resolve(__dirname, '../common');
  3. module.exports = {
  4. publicPath:
  5. process.env.NODE_ENV === "development" ? "/" : process.env.VUE_APP_ROUTER,
  6. // outputDir: process.env.VUE_APP_ROUTER,
  7. configureWebpack: config => {
  8. Object.assign(config, {
  9. // 开发生产共同配置
  10. resolve: {
  11. alias: {
  12. "@": path.resolve(__dirname, "./src"),
  13. "@c": path.resolve(__dirname, "./src/components"),
  14. "@a": path.resolve(__dirname, "./src/assets")
  15. // '@common': common,
  16. }
  17. }
  18. });
  19. },
  20. devServer: {
  21. port: "8001",
  22. //api地址前缀
  23. proxy: {
  24. "/weixin": {
  25. target: "http://smart.cc-lotus.info",
  26. changeOrigin: true,
  27. ws: true
  28. },
  29. "/files": {
  30. target: "http://free.liaoningdoupo.com"
  31. },
  32. "/api": {
  33. target: "http://free.liaoningdoupo.com",
  34. changeOrigin: true,
  35. ws: true
  36. }
  37. }
  38. }
  39. };