vue.config.js 2.4 KB

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