vue.config.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. const url = 'http://127.0.0.1:9999'
  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. transpileDependencies: ['avue-plugin-transfer', 'avue-plugin-ueditor'],
  23. // 配置转发代理
  24. devServer: {
  25. proxy: {
  26. '/auth': {
  27. target: url,
  28. ws: true,
  29. pathRewrite: {
  30. '^/auth': '/auth'
  31. }
  32. },
  33. '/admin': {
  34. target: url,
  35. ws: true,
  36. pathRewrite: {
  37. '^/admin': '/admin'
  38. }
  39. },
  40. '/code': {
  41. target: url,
  42. ws: true,
  43. pathRewrite: {
  44. '^/code': '/code'
  45. }
  46. },
  47. '/gen': {
  48. target: url,
  49. ws: true,
  50. pathRewrite: {
  51. '^/gen': '/gen'
  52. }
  53. },
  54. '/daemon': {
  55. target: url,
  56. ws: true,
  57. pathRewrite: {
  58. '^/daemon': '/daemon'
  59. }
  60. },
  61. '/tx': {
  62. target: url,
  63. ws: true,
  64. pathRewrite: {
  65. '^/tx': '/tx'
  66. }
  67. },
  68. '/act': {
  69. target: url,
  70. ws: true,
  71. pathRewrite: {
  72. '^/act': '/act'
  73. }
  74. }
  75. }
  76. }
  77. }