index.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. // see http://vuejs-templates.github.io/webpack for documentation.
  2. var path = require("path");
  3. // const TEST_HOST = "http://101.36.160.140:10310";
  4. const TEST_HOST = "http://172.16.0.46:9025";
  5. // const TEST_HOST = "http://172.16.0.46:9527";
  6. module.exports = {
  7. build: {
  8. prodEnv: require("./prod.env"),
  9. index: path.resolve(__dirname, "../dist/index.html"),
  10. assetsRoot: path.resolve(__dirname, "../dist"),
  11. assetsSubDirectory: "static",
  12. assetsPublicPath: "./", //请根据自己路径配置更改
  13. productionSourceMap: false,
  14. baseURL: TEST_HOST,
  15. // Gzip off by default as many popular static hosts such as
  16. // Surge or Netlify already gzip all static assets for you.
  17. // Before setting to `true`, make sure to:
  18. // npm install --save-dev compression-webpack-plugin
  19. productionGzip: false,
  20. productionGzipExtensions: ["js", "css"],
  21. // Run the build command with an extra argument to
  22. // View the bundle analyzer report after build finishes:
  23. // `npm run build --report`
  24. // Set to `true` or `false` to always turn it on or off
  25. bundleAnalyzerReport: process.env.npm_config_report,
  26. },
  27. dev: {
  28. host: "localhost", // can be overwritten by process.env.HOST
  29. env: require("./dev.env"),
  30. port: 9527,
  31. autoOpenBrowser: true,
  32. assetsSubDirectory: "static",
  33. assetsPublicPath: "/",
  34. proxyTable: {
  35. "/depot-system": {
  36. target: TEST_HOST,
  37. secure: false, // 如果是https接口,需要配置这个参数
  38. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  39. pathRewrite: {
  40. "^/api": "",
  41. },
  42. },
  43. "/depot-smart-storage": {
  44. target: TEST_HOST,
  45. secure: false, // 如果是https接口,需要配置这个参数
  46. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  47. pathRewrite: {
  48. "^/api": "",
  49. },
  50. },
  51. "/depot-business": {
  52. target: TEST_HOST,
  53. secure: false, // 如果是https接口,需要配置这个参数
  54. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  55. pathRewrite: {
  56. "^/api": "",
  57. },
  58. },
  59. "/depot-agent": {
  60. target: TEST_HOST,
  61. secure: false, // 如果是https接口,需要配置这个参数
  62. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  63. pathRewrite: {
  64. "^/api": "",
  65. },
  66. },
  67. "/depot-basic": {
  68. target: TEST_HOST,
  69. secure: false, // 如果是https接口,需要配置这个参数
  70. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  71. pathRewrite: {
  72. "^/api": "",
  73. },
  74. },
  75. "/depot-storage": {
  76. target: TEST_HOST,
  77. secure: false, // 如果是https接口,需要配置这个参数
  78. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  79. pathRewrite: {
  80. "^/api": "",
  81. },
  82. },
  83. "/depot-qualitycheck": {
  84. target: TEST_HOST,
  85. secure: false, // 如果是https接口,需要配置这个参数
  86. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  87. logLevel: "debug",
  88. // onProxyReq: (proxyReq, req) => {
  89. // // http请求
  90. // // console.log('[HPM] %s %s %s %s', req.method, req.originalUrl, '->', req.url);
  91. // console.log('proxyReq', proxyReq.headers);
  92. // console.log('req', req.headers);
  93. // },
  94. pathRewrite: {
  95. "^/api": "",
  96. },
  97. },
  98. "/depot-device": {
  99. target: TEST_HOST,
  100. secure: false, // 如果是https接口,需要配置这个参数
  101. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  102. pathRewrite: {
  103. "^/api": "",
  104. },
  105. },
  106. "/depot-keeper-account": {
  107. target: TEST_HOST,
  108. secure: false, // 如果是https接口,需要配置这个参数
  109. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  110. pathRewrite: {
  111. "^/api": "",
  112. },
  113. },
  114. "/depot-agile": {
  115. target: TEST_HOST,
  116. secure: false, // 如果是https接口,需要配置这个参数
  117. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  118. pathRewrite: {
  119. "^/api": "",
  120. },
  121. },
  122. "/depot-monitor": {
  123. target: TEST_HOST,
  124. secure: false, // 如果是https接口,需要配置这个参数
  125. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  126. pathRewrite: {
  127. "^/api": "",
  128. },
  129. },
  130. "/depot-smart-storage": {
  131. target: TEST_HOST,
  132. secure: false, // 如果是https接口,需要配置这个参数
  133. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  134. pathRewrite: {
  135. "^/api": "",
  136. },
  137. },
  138. "/loginApi": {
  139. target: TEST_HOST,
  140. secure: false, //如果是https接口,需要配置这个参数
  141. changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
  142. pathRewrite: {
  143. "^/loginApi": "",
  144. },
  145. },
  146. },
  147. // CSS Sourcemaps off by default because relative paths are "buggy"
  148. // with this option, according to the CSS-Loader README
  149. // (https://github.com/webpack/css-loader#sourcemaps)
  150. // In our experience, they generally work as expected,
  151. // just be aware of this issue when enabling this option.
  152. cssSourceMap: false,
  153. },
  154. };