index.js 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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. const proxyTable = require('./conf')
  6. module.exports = {
  7. dev: {
  8. // Paths
  9. assetsSubDirectory: 'static',
  10. assetsPublicPath: '/',
  11. // proxyTable: {//正式环境
  12. // '/admin': {
  13. // target: 'http://mbi.sagacloud.cn:8080',
  14. // changeOrigin: true,
  15. // pathRewrite: {
  16. // "^/admin": "/"
  17. // }
  18. // },
  19. // '/api': {
  20. // target: 'http://mbi.sagacloud.cn:8080',
  21. // changeOrigin: true,
  22. // pathRewrite: {
  23. // "^/api": "/"
  24. // }
  25. // },
  26. // '/data-platform-3': {
  27. // // 目标 API 地址
  28. // target: 'http://api.sagacloud.cn/',
  29. // // 如果要代理 websockets
  30. // ws: true,
  31. // // 将主机标头的原点更改为目标URL
  32. // changeOrigin: false
  33. // },
  34. // '/business-space': {
  35. // // 目标 API 地址
  36. // target: 'http://api.sagacloud.cn',
  37. // changeOrigin: true,
  38. // pathRewrite: {
  39. // "^/business-space": "/dp-auxiliary/business-space/"
  40. // }
  41. // },
  42. // '/pointconfig': {
  43. // // 目标 API 地址
  44. // target: 'http://mbi.sagacloud.cn:8080/',
  45. // // 如果要代理 websockets
  46. // ws: true,
  47. // // 将主机标头的原点更改为目标URL
  48. // changeOrigin: false
  49. // },
  50. // '/venders-dp': {
  51. // // 目标 API 地址
  52. // target: 'http://api.sagacloud.cn',
  53. // changeOrigin: true,
  54. // pathRewrite: {
  55. // "^/venders-dp": "/dp-auxiliary/venders-dp/"
  56. // }
  57. // },
  58. // '/venders': {
  59. // // 目标 API 地址
  60. // target: 'http://api.sagacloud.cn',
  61. // changeOrigin: true,
  62. // pathRewrite: {
  63. // "^/venders": "/dp-auxiliary/venders/"
  64. // }
  65. // },
  66. // '/ScanBuilding': {
  67. // // 目标 API 地址
  68. // target: 'http://mbi.sagacloud.cn:8080/',
  69. // // 如果要代理 websockets
  70. // ws: true,
  71. // // 将主机标头的原点更改为目标URL
  72. // changeOrigin: false
  73. // },
  74. // '/scanbuilding-2': {
  75. // // 目标 API 地址
  76. // target: 'http://mbi.sagacloud.cn:8080/',
  77. // // 如果要代理 websockets
  78. // ws: true,
  79. // // 将主机标头的原点更改为目标URL
  80. // changeOrigin: false
  81. // },
  82. // '/image-service': {
  83. // // 目标 API 地址
  84. // target: 'http://api.sagacloud.cn',
  85. // changeOrigin: true,
  86. // pathRewrite: {
  87. // "^/image-service": "/dp-auxiliary/image-service/"
  88. // }
  89. // },
  90. // '/modelapi': {
  91. // target: 'http://mbi.sagacloud.cn:8080',
  92. // changeOrigin: true,
  93. // pathRewrite: {
  94. // "^/modelapi": "/revit-algorithm/"
  95. // }
  96. // },
  97. // '/schedulerapi': {
  98. // target: 'http://mbi.sagacloud.cn:8080',
  99. // changeOrigin: true,
  100. // pathRewrite: {
  101. // "^/schedulerapi": "/scheduler/"
  102. // }
  103. // },
  104. // },
  105. // proxyTable: { //235测试环境
  106. // '/admin': {
  107. // target: 'http://172.16.44.235:8080',
  108. // changeOrigin: true,
  109. // pathRewrite: {
  110. // "^/admin": "/"
  111. // }
  112. // },
  113. // '/api': {
  114. // target: 'http://172.16.44.235:8080',
  115. // changeOrigin: true,
  116. // pathRewrite: {
  117. // "^/api": "/"
  118. // }
  119. // },
  120. // '/data-platform-3': {
  121. // // 目标 API 地址
  122. // target: 'http://172.16.42.210:8080/',
  123. // // 如果要代理 websockets
  124. // ws: true,
  125. // // 将主机标头的原点更改为目标URL
  126. // changeOrigin: false
  127. // },
  128. // '/business-space': {
  129. // // 目标 API 地址
  130. // target: 'http://172.16.42.210:8080/',
  131. // // 如果要代理 websockets
  132. // ws: true,
  133. // // 将主机标头的原点更改为目标URL
  134. // changeOrigin: false
  135. // },
  136. // '/pointconfig': {
  137. // // 目标 API 地址
  138. // target: 'http://172.16.44.235:8080/',
  139. // // 如果要代理 websockets
  140. // ws: true,
  141. // // 将主机标头的原点更改为目标URL
  142. // changeOrigin: false
  143. // },
  144. // '/venders-dp': {
  145. // // 目标 API 地址
  146. // target: 'http://172.16.42.210:8080/',
  147. // // 如果要代理 websockets
  148. // ws: true,
  149. // // 将主机标头的原点更改为目标URL
  150. // changeOrigin: false
  151. // },
  152. // '/venders': {
  153. // // 目标 API 地址
  154. // target: 'http://172.16.42.210:8080/',
  155. // // 如果要代理 websockets
  156. // ws: true,
  157. // // 将主机标头的原点更改为目标URL
  158. // changeOrigin: false
  159. // },
  160. // '/ScanBuilding': {
  161. // // 目标 API 地址
  162. // target: 'http://172.16.44.235:8080/',
  163. // // 如果要代理 websockets
  164. // ws: true,
  165. // // 将主机标头的原点更改为目标URL
  166. // changeOrigin: false
  167. // },
  168. // '/scanbuilding-2': {
  169. // // 目标 API 地址
  170. // target: 'http://172.16.44.235:8080/',
  171. // // 如果要代理 websockets
  172. // ws: true,
  173. // // 将主机标头的原点更改为目标URL
  174. // changeOrigin: false
  175. // },
  176. // '/image-service': {
  177. // // 目标 API 地址
  178. // target: 'http://172.16.42.210:8080/',
  179. // // 如果要代理 websockets
  180. // ws: true,
  181. // // 将主机标头的原点更改为目标URL
  182. // changeOrigin: false
  183. // },
  184. // '/modelapi': {
  185. // target: 'http://172.16.42.210:8082',
  186. // // target: 'http://192.168.20.218:8082',//景灏
  187. // changeOrigin: true,
  188. // pathRewrite: {
  189. // "^/modelapi": "/"
  190. // }
  191. // },
  192. // '/schedulerapi': {
  193. // target: 'http://172.16.42.210:8081',
  194. // changeOrigin: true,
  195. // pathRewrite: {
  196. // "^/schedulerapi": "/"
  197. // }
  198. // },
  199. // },
  200. proxyTable: proxyTable["14"],
  201. // Various Dev Server settings
  202. host: '0.0.0.0', // can be overwritten by process.env.HOST
  203. port: 28080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  204. autoOpenBrowser: false,
  205. errorOverlay: true,
  206. notifyOnErrors: true,
  207. poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  208. /**
  209. * Source Maps
  210. */
  211. // https://webpack.js.org/configuration/devtool/#development
  212. devtool: 'cheap-module-eval-source-map',
  213. // If you have problems debugging vue-files in devtools,
  214. // set this to false - it *may* help
  215. // https://vue-loader.vuejs.org/en/options.html#cachebusting
  216. cacheBusting: true,
  217. cssSourceMap: true
  218. },
  219. build: {
  220. // Template for index.html
  221. index: path.resolve(__dirname, '../dist/index.html'),
  222. // Paths
  223. assetsRoot: path.resolve(__dirname, '../dist'),
  224. assetsSubDirectory: 'static',
  225. // assetsPublicPath: '/adm/',// 39 配置
  226. assetsPublicPath: '/',
  227. /**
  228. * Source Maps
  229. */
  230. productionSourceMap: true,
  231. // https://webpack.js.org/configuration/devtool/#production
  232. devtool: '#source-map',
  233. // Gzip off by default as many popular static hosts such as
  234. // Surge or Netlify already gzip all static assets for you.
  235. // Before setting to `true`, make sure to:
  236. // npm install --save-dev compression-webpack-plugin
  237. productionGzip: false,
  238. productionGzipExtensions: ['js', 'css'],
  239. // Run the build command with an extra argument to
  240. // View the bundle analyzer report after build finishes:
  241. // `npm run build --report`
  242. // Set to `true` or `false` to always turn it on or off
  243. bundleAnalyzerReport: process.env.npm_config_report
  244. }
  245. }