vue.config.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /**
  2. * 配置参考:
  3. * https://cli.vuejs.org/zh/config/
  4. */
  5. const url = 'http://pigx-gateway:9999'
  6. module.exports = {
  7. lintOnSave: true,
  8. productionSourceMap: false,
  9. chainWebpack: config => {
  10. // 忽略的打包文件
  11. config.externals({
  12. 'axios': 'axios'
  13. })
  14. const entry = config.entry('app')
  15. entry
  16. .add('babel-polyfill')
  17. .end()
  18. entry
  19. .add('classlist-polyfill')
  20. .end()
  21. },
  22. // 配置转发代理
  23. devServer: {
  24. disableHostCheck: true,
  25. port: 8080,
  26. proxy: {
  27. '/auth': {
  28. target: url,
  29. ws: true,
  30. pathRewrite: {
  31. '^/auth': '/auth'
  32. }
  33. },
  34. '/admin': {
  35. target: url,
  36. ws: true,
  37. pathRewrite: {
  38. '^/admin': '/admin'
  39. }
  40. },
  41. '/code': {
  42. target: url,
  43. ws: true,
  44. pathRewrite: {
  45. '^/code': '/code'
  46. }
  47. },
  48. '/gen': {
  49. target: url,
  50. ws: true,
  51. pathRewrite: {
  52. '^/gen': '/gen'
  53. }
  54. },
  55. '/actuator': {
  56. target: url,
  57. ws: true,
  58. pathRewrite: {
  59. '^/actuator': '/actuator'
  60. }
  61. },
  62. '/monitor': {
  63. target: url,
  64. ws: true,
  65. pathRewrite: {
  66. '^/monitor': '/monitor'
  67. }
  68. },
  69. '/mp': {
  70. target: url,
  71. ws: true,
  72. pathRewrite: {
  73. '^/mp': '/mp'
  74. }
  75. },
  76. '/daemon': {
  77. target: url,
  78. ws: true,
  79. pathRewrite: {
  80. '^/daemon': '/daemon'
  81. }
  82. },
  83. '/job': {
  84. target: url,
  85. ws: true,
  86. pathRewrite: {
  87. '^/job': '/job'
  88. }
  89. },
  90. '/tx': {
  91. target: url,
  92. ws: true,
  93. pathRewrite: {
  94. '^/tx': '/tx'
  95. }
  96. },
  97. '/pay': {
  98. target: url,
  99. ws: true,
  100. pathRewrite: {
  101. '^/pay': '/pay'
  102. }
  103. },
  104. '/act': {
  105. target: url,
  106. ws: true,
  107. pathRewrite: {
  108. '^/act': '/act'
  109. }
  110. }
  111. }
  112. }
  113. }