index.js 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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. // 网站模块名,例如 http://192.168.0.216:8089/module/app/initlayer.html 中的
  7. //【views】,默认为views,修改这里的配置的同时,也要同时重命名/src/views的这个文件夹名称
  8. // moduleName: 'zhongsteel.ytg', // http://localhost:8081/#/views/user.html
  9. // apolloclear
  10. dev: {
  11. // Paths
  12. assetsSubDirectory: 'static',
  13. assetsPublicPath: '/',
  14. proxyTable: {
  15. '/zhongsteel.pass.web/pass/v1': {
  16. target: 'http://172.16.90.238:8088/v1', //加http
  17. // target: 'http://192.168.10.191:9001/v1', //加http
  18. changeOrigin: true,
  19. pathRewrite: {
  20. '^/zhongsteel.pass.web/pass/v1': '/' //这里理解成用‘/api’代替target里面的地址,组件中我们调接口时直接用/api代替
  21. // 比如我要调用'http://0.0:300/user/add',直接写‘/api/user/add’即可 代理后地址栏显示/
  22. }
  23. },
  24. '/zhongsteel.pass.web/pass/auth': {
  25. target: 'http://172.16.90.238:8088/auth', //加http
  26. // target: 'http://192.168.10.191:9001/auth', //加http
  27. changeOrigin: true,
  28. pathRewrite: {
  29. '^/zhongsteel.pass.web/pass/auth': '/' //这里理解成用‘/api’代替target里面的地址,组件中我们调接口时直接用/api代替
  30. // 比如我要调用'http://0.0:300/user/add',直接写‘/api/user/add’即可 代理后地址栏显示/
  31. }
  32. },
  33. '/zhongsteel.pass.web/pass/logout': {
  34. target: 'http://172.16.90.238:8088/logout', //加http
  35. changeOrigin: true,
  36. pathRewrite: {
  37. '^/zhongsteel.pass.web/pass/logout': '/' //这里理解成用‘/api’代替target里面的地址,组件中我们调接口时直接用/api代替
  38. // 比如我要调用'http://0.0:300/user/add',直接写‘/api/user/add’即可 代理后地址栏显示/
  39. }
  40. },
  41. '/zhongsteel.pass.web/pass/configCenter': {
  42. target: 'https://config.steerinfo.com/configCenter', //加http
  43. changeOrigin: true,
  44. pathRewrite: {
  45. '^/zhongsteel.pass.web/pass/configCenter': '/' //这里理解成用‘/api’代替target里面的地址,组件中我们调接口时直接用/api代替
  46. // 比如我要调用'http://0.0:300/user/add',直接写‘/api/user/add’即可 代理后地址栏显示/
  47. }
  48. },
  49. '/zhongsteel.pass.web/pass/serviceCenter': {
  50. target: 'https://service-govern.steerinfo.com',
  51. changeOrigin: true,
  52. pathRewrite: {
  53. '^/zhongsteel.pass.web/pass': '/'
  54. }
  55. },
  56. '/zhongsteel.pass.web/pass/act': {
  57. target: 'https://act.steerinfo.com',
  58. changeOrigin: true,
  59. pathRewrite: {
  60. '^/zhongsteel.pass.web/pass/act': '/'
  61. }
  62. },
  63. '/icore-api': {
  64. target: 'http://172.16.90.238:8088',
  65. changeOrigin: true,
  66. pathRewrite: {
  67. '^/icore-api': '/'
  68. }
  69. },
  70. '/zhongsteel.pass.web/pass/ems': {
  71. // target: '172.16.90.238:8888',
  72. target: 'http://localhost:8086',
  73. changeOrigin: true,
  74. pathRewrite: {
  75. '^/zhongsteel.pass.web/pass/ems': '/'
  76. }
  77. },
  78. '/zhongsteel.pass.web/pass/product': {
  79. target: 'http://localhost:8888',
  80. // target: '172.16.90.238:8089',
  81. changeOrigin: true,
  82. pathRewrite: {
  83. '^/zhongsteel.pass.web/pass/product': '/'
  84. }
  85. },
  86. '/zhongsteel.pass.web/pass/localhost': {
  87. target: 'http://localhost:8888',
  88. changeOrigin: true,
  89. pathRewrite: {
  90. '^/zhongsteel.pass.web/pass/localhost': '/'
  91. }
  92. },
  93. '/zhongsteel.pass.web/pass/emswebsocket': {
  94. // target: '172.16.90.238:8888',
  95. target: 'http://localhost:8086',
  96. ws: true,
  97. changeOrigin: true,
  98. pathRewrite: {
  99. '^/zhongsteel.pass.web/pass/emswebsocket': '/'
  100. }
  101. }
  102. // '/websocket': {
  103. // target: 'ws://localhost:8086',
  104. // ws: true, // 开启websocket代理 注意
  105. // changeOrigin: true,
  106. // pathRewrite: {
  107. // '^/websocket': '/'
  108. // }
  109. // }
  110. },
  111. // Various Dev Server settings
  112. host: 'localhost', // can be overwritten by process.env.HOST
  113. port: 8089, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
  114. autoOpenBrowser: false,
  115. errorOverlay: true,
  116. notifyOnErrors: true,
  117. poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
  118. // Use Eslint Loader?
  119. // If true, your code will be linted during bundling and
  120. // linting errors and warnings will be shown in the console.
  121. useEslint: true,
  122. // If true, eslint errors and warnings will also be shown in the error overlay
  123. // in the browser.
  124. showEslintErrorsInOverlay: false,
  125. /**
  126. * Source Maps
  127. */
  128. // https://webpack.js.org/configuration/devtool/#development
  129. // devtool: 'cheap-module-eval-source-map',
  130. // If you have problems debugging vue-files in devtools,
  131. // set this to false - it *may* help
  132. // https://vue-loader.vuejs.org/en/options.html#cachebusting
  133. cacheBusting: true,
  134. cssSourceMap: false
  135. },
  136. build: {
  137. // Template for index.html
  138. index: path.resolve(__dirname, '../dist/index.html'),
  139. // Paths
  140. assetsRoot: path.resolve(__dirname, '../dist'),
  141. assetsSubDirectory: 'static', // 打包后 static放的位置
  142. assetsPublicPath: '../', // html中webpack打包的JS -> ../static/xxx.js
  143. /**
  144. * Source Maps
  145. */
  146. productionSourceMap: false,
  147. // https://webpack.js.org/configuration/devtool/#production
  148. devtool: '#source-map',
  149. // Gzip off by default as many popular static hosts such as
  150. // Surge or Netlify already gzip all static assets for you.
  151. // Before setting to `true`, make sure to:
  152. // npm install --save-dev compression-webpack-plugin
  153. productionGzip: false,
  154. productionGzipExtensions: ['js', 'css'],
  155. // Run the build command with an extra argument to
  156. // View the bundle analyzer report after build finishes:
  157. // `npm run build --report`
  158. // Set to `true` or `false` to always turn it on or off
  159. bundleAnalyzerReport: process.env.npm_config_report
  160. }
  161. }