vue.config.js 2.0 KB

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