index.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. 'use strict'
  2. // Template version: 1.3.1
  3. // see http://vuejs-templates.github.io/webpack for documentation.
  4. const path = require('path')
  5. module.exports = {
  6. dev: {
  7. // Paths
  8. assetsSubDirectory: 'static',
  9. assetsPublicPath: '/',
  10. proxyTable: {
  11. '/admin': {
  12. target: 'http://mbi.sagacloud.cn:8080',
  13. changeOrigin: true,
  14. pathRewrite: {
  15. "^/admin": "/"
  16. }
  17. },
  18. '/api': {
  19. target: 'http://mbi.sagacloud.cn:8080',
  20. changeOrigin: true,
  21. pathRewrite: {
  22. "^/api": "/"
  23. }
  24. },
  25. '/data-platform-3': {
  26. // 目标 API 地址
  27. target: 'http://api.sagacloud.cn/',
  28. // 如果要代理 websockets
  29. ws: true,
  30. // 将主机标头的原点更改为目标URL
  31. changeOrigin: false
  32. },
  33. '/business-space': {
  34. // 目标 API 地址
  35. target: 'http://api.sagacloud.cn',
  36. changeOrigin: true,
  37. pathRewrite: {
  38. "^/business-space": "/dp-auxiliary/business-space/"
  39. }
  40. },
  41. '/pointconfig': {
  42. // 目标 API 地址
  43. target: 'http://mbi.sagacloud.cn:8080/',
  44. // 如果要代理 websockets
  45. ws: true,
  46. // 将主机标头的原点更改为目标URL
  47. changeOrigin: false
  48. },
  49. '/venders-dp': {
  50. // 目标 API 地址
  51. target: 'http://api.sagacloud.cn',
  52. changeOrigin: true,
  53. pathRewrite: {
  54. "^/venders-dp": "/dp-auxiliary/venders-dp/"
  55. }
  56. },
  57. '/venders': {
  58. // 目标 API 地址
  59. target: 'http://api.sagacloud.cn',
  60. changeOrigin: true,
  61. pathRewrite: {
  62. "^/venders": "/dp-auxiliary/venders/"
  63. }
  64. },
  65. '/ScanBuilding': {
  66. // 目标 API 地址
  67. target: 'http://mbi.sagacloud.cn:8080/',
  68. // 如果要代理 websockets
  69. ws: true,
  70. // 将主机标头的原点更改为目标URL
  71. changeOrigin: false
  72. },
  73. '/image-service': {
  74. // 目标 API 地址
  75. target: 'http://api.sagacloud.cn',
  76. changeOrigin: true,
  77. pathRewrite: {
  78. "^/image-service": "/dp-auxiliary/image-service/"
  79. }
  80. },
  81. '/modelapi': {
  82. target: 'http://mbi.sagacloud.cn:8080',
  83. changeOrigin: true,
  84. pathRewrite: {
  85. "^/modelapi": "/revit-algorithm/"
  86. }
  87. },
  88. '/schedulerapi': {
  89. target: 'http://mbi.sagacloud.cn:8080',
  90. changeOrigin: true,
  91. pathRewrite: {
  92. "^/schedulerapi": "/scheduler/"
  93. }
  94. },
  95. },
  96. // Various Dev Server settings
  97. host: '0.0.0.0', // can be overwritten by process.env.HOST
  98. port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  99. autoOpenBrowser: false,
  100. errorOverlay: true,
  101. notifyOnErrors: true,
  102. poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  103. /**
  104. * Source Maps
  105. */
  106. // https://webpack.js.org/configuration/devtool/#development
  107. devtool: 'cheap-module-eval-source-map',
  108. // If you have problems debugging vue-files in devtools,
  109. // set this to false - it *may* help
  110. // https://vue-loader.vuejs.org/en/options.html#cachebusting
  111. cacheBusting: true,
  112. cssSourceMap: true
  113. },
  114. build: {
  115. // Template for index.html
  116. index: path.resolve(__dirname, '../dist/index.html'),
  117. // Paths
  118. assetsRoot: path.resolve(__dirname, '../dist'),
  119. assetsSubDirectory: 'static',
  120. assetsPublicPath: '/',
  121. /**
  122. * Source Maps
  123. */
  124. productionSourceMap: true,
  125. // https://webpack.js.org/configuration/devtool/#production
  126. devtool: '#source-map',
  127. // Gzip off by default as many popular static hosts such as
  128. // Surge or Netlify already gzip all static assets for you.
  129. // Before setting to `true`, make sure to:
  130. // npm install --save-dev compression-webpack-plugin
  131. productionGzip: false,
  132. productionGzipExtensions: ['js', 'css'],
  133. // Run the build command with an extra argument to
  134. // View the bundle analyzer report after build finishes:
  135. // `npm run build --report`
  136. // Set to `true` or `false` to always turn it on or off
  137. bundleAnalyzerReport: process.env.npm_config_report
  138. }
  139. }