vue.config.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. const path = require("path");
  2. const name = "wanda-adm";
  3. const devServerPort = 28888;
  4. const stageServerPort = 28889;
  5. module.exports = {
  6. // TODO: Remember to change publicPath to fit your need
  7. publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
  8. lintOnSave: process.env.NODE_ENV === "development",
  9. productionSourceMap: false,
  10. devServer: {
  11. port: devServerPort,
  12. open: true,
  13. overlay: {
  14. warning: false,
  15. errors: true
  16. },
  17. progress: false,
  18. proxy: {
  19. [process.env.VUE_APP_BASE_API]: {
  20. target: `http://127.0.0.1:${stageServerPort}/mock-api/v1`,
  21. changeOrigin: true, // needed for virtual hosted sites
  22. ws: true, // proxy websockets
  23. pathRewrite: {
  24. ["^" + process.env.VUE_APP_BASE_API]: ""
  25. }
  26. },
  27. "/datacenter": {
  28. target: "http://192.168.64.17:28890",
  29. changeOrigin: true
  30. },
  31. "/equip-component": {
  32. target: "http://192.168.64.17:28890",
  33. changeOrigin: true
  34. },
  35. "/modelapi": {
  36. target: "http://192.168.64.17:28890",
  37. changeOrigin: true,
  38. pathRewrite: {
  39. "^/modelapi": "/revit-algorithm"
  40. }
  41. },
  42. "/message-center": {
  43. target: "http://192.168.64.17:28890",
  44. changeOrigin: true
  45. },
  46. "/image-service": {
  47. target: "http://39.97.179.199:8891",
  48. changeOrigin: true
  49. }
  50. }
  51. },
  52. pluginOptions: {
  53. "style-resources-loader": {
  54. preProcessor: "scss",
  55. patterns: [
  56. path.resolve(__dirname, "src/styles/_variables.scss"),
  57. path.resolve(__dirname, "src/styles/_mixins.scss")
  58. ]
  59. }
  60. },
  61. chainWebpack(config) {
  62. //在html网页包插件的选项列表中提供应用程序的标题,以便
  63. //可以在中访问索引.html插入正确的标题。
  64. // https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-plugin
  65. config.plugin("html").tap(args => {
  66. args[0].title = name;
  67. return args;
  68. });
  69. }
  70. };