vue.config.js 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. const path = require("path");
  2. const name = "wanda-adm";
  3. const devServerPort = 28888;
  4. const stageServerPort = 28889;
  5. module.exports = {
  6. // TODO: 更改 publicPath 打包静态文件目录的配置
  7. publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
  8. // TODO:打包名称
  9. outputDir: "wanda-adm",
  10. //TODO: eslint 是否在保存时检查
  11. lintOnSave: process.env.NODE_ENV === "development",
  12. productionSourceMap: false,
  13. devServer: {
  14. port: devServerPort,
  15. open: true,
  16. overlay: {
  17. warning: false,
  18. errors: true
  19. },
  20. progress: false,
  21. proxy: {
  22. [process.env.VUE_APP_BASE_API]: {
  23. target: `http://127.0.0.1:${stageServerPort}/mock-api/v1`,
  24. changeOrigin: true, // needed for virtual hosted sites
  25. ws: true, // proxy websockets
  26. pathRewrite: {
  27. ["^" + process.env.VUE_APP_BASE_API]: ""
  28. }
  29. },
  30. "/datacenter": {
  31. target: "http://192.168.64.17:28890",
  32. // target: "http://192.168.0.72:8080",
  33. changeOrigin: true
  34. },
  35. "/equip-component": {
  36. target: "http://192.168.64.17:28890",
  37. // target: "http://192.168.0.72:8080",
  38. changeOrigin: true
  39. },
  40. "/schedulerapi": {
  41. target: "http://192.168.64.17:28890",
  42. // target: "http://192.168.0.72:8080",
  43. changeOrigin: true,
  44. pathRewrite: {
  45. "^/schedulerapi": "/scheduler"
  46. }
  47. },
  48. "/modelapi": {
  49. target: "http://192.168.64.17:28890",
  50. // target: "http://192.168.0.72:8080",
  51. changeOrigin: true,
  52. pathRewrite: {
  53. "^/modelapi": "/revit-algorithm"
  54. }
  55. },
  56. // "/modelapi": {
  57. // target: "http://192.168.0.55:8080",
  58. // changeOrigin: true,
  59. // pathRewrite: {
  60. // "^/modelapi": "/"
  61. // }
  62. // },
  63. "/message-center": {
  64. target: "http://192.168.64.17:28890",
  65. // target: "http://192.168.0.72:8080",
  66. changeOrigin: true
  67. },
  68. "/rwd": {
  69. target: "http://39.102.40.239:9970",
  70. changeOrigin: true
  71. },
  72. "/image-service": {
  73. target: "http://39.97.179.199:8891",
  74. changeOrigin: true
  75. }
  76. }
  77. },
  78. //配置插件
  79. pluginOptions: {
  80. "style-resources-loader": {
  81. preProcessor: "scss",
  82. patterns: [
  83. path.resolve(__dirname, "src/styles/_variables.scss"),
  84. path.resolve(__dirname, "src/styles/_mixins.scss")
  85. ]
  86. }
  87. },
  88. // 高级配置
  89. chainWebpack(config) {
  90. //在html网页包插件的选项列表中提供应用程序的标题,以便
  91. //可以在中访问索引.html插入正确的标题。
  92. // https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-plugin
  93. config.plugin("html").tap(args => {
  94. args[0].title = name;
  95. return args;
  96. });
  97. }
  98. };