vue.config.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. module.exports = {
  2. //路径前缀
  3. publicPath: "/",
  4. lintOnSave: true,
  5. productionSourceMap: false,
  6. chainWebpack: (config) => {
  7. //忽略的打包文件
  8. config.externals({
  9. 'vue': 'Vue',
  10. 'vue-router': 'VueRouter',
  11. 'vuex': 'Vuex',
  12. 'axios': 'axios',
  13. 'element-ui': 'ELEMENT',
  14. });
  15. const entry = config.entry('app');
  16. entry.add('babel-polyfill').end();
  17. entry.add('classlist-polyfill').end();
  18. entry.add('@/mock').end();
  19. },
  20. devServer: {
  21. port: 1999,
  22. proxy: {
  23. '/api': {
  24. //本地服务接口地址
  25. // target: 'http://139.9.103.171:9527',
  26. target: 'http://localhost:9527',
  27. //远程演示服务地址,可用于直接启动项目
  28. //target: 'https://saber.bladex.vip/api',
  29. ws: true,
  30. pathRewrite: {
  31. '^/api': '/'
  32. }
  33. },
  34. '/grid': {
  35. //本地服务接口地址
  36. target: 'http://localhost:9083',
  37. //远程演示服务地址,可用于直接启动项目
  38. //target: 'https://saber.bladex.vip/api',
  39. ws: true,
  40. // pathRewrite: {
  41. // '^/testapi': '/'
  42. // }
  43. },
  44. '/estate': {
  45. //本地服务接口地址
  46. target: 'http://localhost:2004',
  47. //远程演示服务地址,可用于直接启动项目
  48. //target: 'https://saber.bladex.vip/api',
  49. ws: true,
  50. pathRewrite: {
  51. '^/estate': '/'
  52. }
  53. },
  54. '/common': {
  55. //本地服务接口地址
  56. target: 'http://localhost:9091',
  57. //远程演示服务地址,可用于直接启动项目
  58. //target: 'https://saber.bladex.vip/api',
  59. ws: true,
  60. // pathRewrite: {
  61. // '^/testapi': '/'
  62. // }
  63. },
  64. '/vcDevice': {
  65. //本地服务接口地址
  66. target: 'http://localhost:2007',
  67. //远程演示服务地址,可用于直接启动项目
  68. //target: 'https://saber.bladex.vip/api',
  69. ws: true,
  70. // pathRewrite: {
  71. // '^/testapi': '/'
  72. // }
  73. },
  74. }
  75. }
  76. };