index.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. 'use strict'
  2. // Template version: 1.1.1
  3. // see http://vuejs-templates.github.io/webpack for documentation.
  4. const path = require('path')
  5. let project = "gezhouba";
  6. const devServer = require('./dev/' + project + '.js'); //服务信息
  7. module.exports = {
  8. project: "", //打包需要使用(sass-loader)
  9. build: {
  10. env: require('./prod.env'),
  11. index: path.resolve(__dirname, '../dist/index.html'),
  12. assetsRoot: path.resolve(__dirname, '../dist'),
  13. assetsSubDirectory: 'static',
  14. assetsPublicPath: './',
  15. productionSourceMap: true,
  16. // Gzip off by default as many popular static hosts such as
  17. // Surge or Netlify already gzip all static assets for you.
  18. // Before setting to `true`, make sure to:
  19. // npm install --save-dev compression-webpack-plugin
  20. productionGzip: false,
  21. productionGzipExtensions: ['js', 'css'],
  22. // Run the build command with an extra argument to
  23. // View the bundle analyzer report after build finishes:
  24. // `npm run build --report`
  25. // Set to `true` or `false` to always turn it on or off
  26. bundleAnalyzerReport: process.env.npm_config_report
  27. },
  28. dev: {
  29. env: require('./dev.env'),
  30. port: process.env.PORT || 8085,
  31. autoOpenBrowser: true,
  32. assetsSubDirectory: 'static',
  33. assetsPublicPath: '/',
  34. proxyTable: {
  35. "/activity": { //活动
  36. target: devServer("activity"),
  37. secure: false,
  38. changeOrigin: true,
  39. pathRewrite: {
  40. '^/activity': '/'
  41. }
  42. },
  43. "/community": { //会员认证测试用
  44. target: devServer("community"),
  45. secure: false,
  46. changeOrigin: true,
  47. pathRewrite: {
  48. '^/community': '/'
  49. }
  50. },
  51. "/knowledge": { //文章
  52. target: devServer("knowledge"),
  53. secure: false,
  54. changeOrigin: true,
  55. pathRewrite: {
  56. '^/knowledge': '/'
  57. }
  58. },
  59. "/landcrm": { //基础服务
  60. target: devServer("landcrm"),
  61. secure: false,
  62. changeOrigin: true,
  63. pathRewrite: {
  64. '^/landcrm': '/'
  65. }
  66. },
  67. "/manage": { //微信运营
  68. target: devServer("manage"),
  69. secure: false,
  70. changeOrigin: true,
  71. pathRewrite: {
  72. '^/manage': '/'
  73. }
  74. },
  75. "/statistic": { //统计
  76. target: devServer("statistic"),
  77. secure: false,
  78. changeOrigin: true,
  79. pathRewrite: {
  80. '^/statistic': '/'
  81. }
  82. },
  83. "/points": { //积分
  84. target: devServer("points"),
  85. secure: false,
  86. changeOrigin: true,
  87. pathRewrite: {
  88. '^/points': '/'
  89. }
  90. },
  91. "/question": { //问卷调查
  92. target: devServer("question"),
  93. secure: false,
  94. changeOrigin: true,
  95. pathRewrite: {
  96. '^/question': '/'
  97. }
  98. },
  99. "/steward": { //管家
  100. target: devServer("steward"),
  101. secure: false,
  102. changeOrigin: true,
  103. pathRewrite: {
  104. '^/steward': '/'
  105. }
  106. },
  107. "/itemBorrow": { //管家 物品管理
  108. target: devServer("itemBorrow"),
  109. secure: false,
  110. changeOrigin: true,
  111. pathRewrite: {
  112. '^/itemBorrow': '/'
  113. }
  114. },
  115. "/borrowRecord": { //管家 物品借用记录
  116. target: devServer("borrowRecord"),
  117. secure: false,
  118. changeOrigin: true,
  119. pathRewrite: {
  120. '^/borrowRecord': '/'
  121. }
  122. },
  123. "/activiti": { //订餐 会议室预定
  124. target: devServer("activiti"),
  125. secure: false,
  126. changeOrigin: true,
  127. pathRewrite: {
  128. '^/activiti': '/'
  129. },
  130. },
  131. "/propaganda": { //员工故事
  132. target: devServer("propaganda"),
  133. secure: false,
  134. changeOrigin: true,
  135. pathRewrite: {
  136. '^/propaganda': '/'
  137. }
  138. },
  139. "/sterilization": { // 消杀计划
  140. target: devServer("sterilization"),
  141. secure: false,
  142. changeOrigin: true,
  143. pathRewrite: {
  144. '^/sterilization': '/'
  145. }
  146. },
  147. "/file": { //文件服务器
  148. target: devServer("uploadFile"), // 文件上传
  149. secure: false,
  150. changeOrigin: true,
  151. pathRewrite: {
  152. '^/file': '/'
  153. }
  154. },
  155. "/purchase": { //采购供应商管理测试
  156. //target: "http://www.jihengcc.cn:17080/purchase", //采购供应商管理测试
  157. target: "http://172.18.1.40:8080/purchase", //采购供应商管理测试
  158. secure: false,
  159. changeOrigin: true,
  160. pathRewrite: {
  161. '^/purchase': '/'
  162. }
  163. }
  164. },
  165. // CSS Sourcemaps off by default because relative paths are "buggy"
  166. // with this option, according to the CSS-Loader README
  167. // (https://github.com/webpack/css-loader#sourcemaps)
  168. // In our experience, they generally work as expected,
  169. // just be aware of this issue when enabling this option.
  170. cssSourceMap: false
  171. }
  172. }