vue.config.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. const url = 'http://139.224.200.249:19999'
  2. module.exports = {
  3. lintOnSave: true,
  4. productionSourceMap: false,
  5. chainWebpack: config => {
  6. // 忽略的打包文件
  7. config.externals({
  8. 'vue': 'Vue',
  9. 'vue-router': 'VueRouter',
  10. 'vuex': 'Vuex',
  11. 'axios': 'axios',
  12. 'element-ui': 'ELEMENT'
  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. proxy: {
  25. '/auth': {
  26. target: url,
  27. ws: true,
  28. pathRewrite: {
  29. '^/auth': '/auth'
  30. }
  31. },
  32. '/admin': {
  33. target: url,
  34. ws: true,
  35. pathRewrite: {
  36. '^/admin': '/admin'
  37. }
  38. },
  39. '/code': {
  40. target: url,
  41. ws: true,
  42. pathRewrite: {
  43. '^/code': '/code'
  44. }
  45. },
  46. '/gen': {
  47. target: url,
  48. ws: true,
  49. pathRewrite: {
  50. '^/gen': '/gen'
  51. }
  52. },
  53. '/daemon': {
  54. target: url,
  55. ws: true,
  56. pathRewrite: {
  57. '^/daemon': '/daemon'
  58. }
  59. },
  60. '/tx': {
  61. target: url,
  62. ws: true,
  63. pathRewrite: {
  64. '^/tx': '/tx'
  65. }
  66. },
  67. '/act': {
  68. target: url,
  69. ws: true,
  70. pathRewrite: {
  71. '^/act': '/act'
  72. }
  73. }
  74. }
  75. }
  76. }