vue.config.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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" ? "/wanda-adm/" : "/",
  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://60.205.177.43:28888",
  29. changeOrigin: true
  30. },
  31. "/modelapi": {
  32. target: "http://39.102.40.239:8080",
  33. changeOrigin: true,
  34. pathRewrite: {
  35. "^/modelapi": "/revit-algorithm"
  36. }
  37. },
  38. "/message-center": {
  39. target: "http://39.102.40.239:8080",
  40. changeOrigin: true
  41. },
  42. "/image-service": {
  43. target: "http://39.97.179.199:8891",
  44. changeOrigin: true
  45. }
  46. }
  47. },
  48. pluginOptions: {
  49. "style-resources-loader": {
  50. preProcessor: "scss",
  51. patterns: [
  52. path.resolve(__dirname, "src/styles/_variables.scss"),
  53. path.resolve(__dirname, "src/styles/_mixins.scss")
  54. ]
  55. }
  56. },
  57. chainWebpack(config) {
  58. //在html网页包插件的选项列表中提供应用程序的标题,以便
  59. //可以在中访问索引.html插入正确的标题。
  60. // https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-plugin
  61. config.plugin("html").tap(args => {
  62. args[0].title = name;
  63. return args;
  64. });
  65. }
  66. };