vue.config.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. const url = 'http://localhost:9999'
  2. module.exports = {
  3. lintOnSave: true,
  4. productionSourceMap: false,
  5. chainWebpack: (config) => {
  6. config.externals({
  7. 'vue': 'Vue',
  8. 'vue-router': 'VueRouter',
  9. 'vuex': 'Vuex',
  10. 'axios': 'axios',
  11. 'element-ui': 'ELEMENT',
  12. })
  13. },
  14. transpileDependencies: ['avue-plugin-transfer', 'avue-plugin-ueditor'],
  15. //配置转发代理
  16. devServer: {
  17. proxy: {
  18. '/auth': {
  19. target: url,
  20. ws: true,
  21. pathRewrite: {
  22. '^/auth': '/auth'
  23. }
  24. },
  25. '/admin': {
  26. target: url,
  27. ws: true,
  28. pathRewrite: {
  29. '^/admin': '/admin'
  30. }
  31. },
  32. '/code': {
  33. target: url,
  34. ws: true,
  35. pathRewrite: {
  36. '^/code': '/code'
  37. }
  38. },
  39. '/gen': {
  40. target: url,
  41. ws: true,
  42. pathRewrite: {
  43. '^/gen': '/gen'
  44. }
  45. },
  46. '/daemon': {
  47. target: url,
  48. ws: true,
  49. pathRewrite: {
  50. '^/daemon': '/daemon'
  51. }
  52. },
  53. '/tx': {
  54. target: url,
  55. ws: true,
  56. pathRewrite: {
  57. '^/tx': '/tx'
  58. }
  59. },
  60. '/act': {
  61. target: url,
  62. ws: true,
  63. pathRewrite: {
  64. '^/act': '/act'
  65. }
  66. },
  67. }
  68. }
  69. }