vue.config.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. },
  15. transpileDependencies: ['avue-plugin-transfer', 'avue-plugin-ueditor'],
  16. // 配置转发代理
  17. devServer: {
  18. proxy: {
  19. '/auth': {
  20. target: url,
  21. ws: true,
  22. pathRewrite: {
  23. '^/auth': '/auth'
  24. }
  25. },
  26. '/admin': {
  27. target: url,
  28. ws: true,
  29. pathRewrite: {
  30. '^/admin': '/admin'
  31. }
  32. },
  33. '/code': {
  34. target: url,
  35. ws: true,
  36. pathRewrite: {
  37. '^/code': '/code'
  38. }
  39. },
  40. '/gen': {
  41. target: url,
  42. ws: true,
  43. pathRewrite: {
  44. '^/gen': '/gen'
  45. }
  46. },
  47. '/daemon': {
  48. target: url,
  49. ws: true,
  50. pathRewrite: {
  51. '^/daemon': '/daemon'
  52. }
  53. },
  54. '/tx': {
  55. target: url,
  56. ws: true,
  57. pathRewrite: {
  58. '^/tx': '/tx'
  59. }
  60. },
  61. '/act': {
  62. target: url,
  63. ws: true,
  64. pathRewrite: {
  65. '^/act': '/act'
  66. }
  67. }
  68. }
  69. }
  70. }