vue.config.js 1.9 KB

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