index.js 6.0 KB

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