vue.config.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. "/image-service": {
  39. target: "http://39.97.179.199:8891",
  40. changeOrigin: true
  41. }
  42. }
  43. },
  44. pluginOptions: {
  45. "style-resources-loader": {
  46. preProcessor: "scss",
  47. patterns: [
  48. path.resolve(__dirname, "src/styles/_variables.scss"),
  49. path.resolve(__dirname, "src/styles/_mixins.scss")
  50. ]
  51. }
  52. },
  53. chainWebpack(config) {
  54. //在html网页包插件的选项列表中提供应用程序的标题,以便
  55. //可以在中访问索引.html插入正确的标题。
  56. // https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-plugin
  57. config.plugin("html").tap(args => {
  58. args[0].title = name;
  59. return args;
  60. });
  61. }
  62. };