vue.config.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. module.exports = {
  2. //路径前缀
  3. publicPath: "/community/",
  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: 1888,
  22. proxy: {
  23. '/api': {
  24. //本地服务接口地址
  25. target: 'http://192.168.1.69:9527',
  26. //远程演示服务地址,可用于直接启动项目
  27. //target: 'https://saber.bladex.vip/api',
  28. ws: true,
  29. pathRewrite: {
  30. '^/api': '/'
  31. }
  32. },
  33. '/grid': {
  34. //本地服务接口地址
  35. target: 'http://localhost:9083',
  36. //远程演示服务地址,可用于直接启动项目
  37. //target: 'https://saber.bladex.vip/api',
  38. ws: true,
  39. // pathRewrite: {
  40. // '^/testapi': '/'
  41. // }
  42. },
  43. '/estate': {
  44. //本地服务接口地址
  45. target: 'http://localhost:2004',
  46. //远程演示服务地址,可用于直接启动项目
  47. //target: 'https://saber.bladex.vip/api',
  48. ws: true,
  49. pathRewrite: {
  50. '^/estate': '/'
  51. }
  52. },
  53. '/common': {
  54. //本地服务接口地址
  55. target: 'http://localhost:9091',
  56. //远程演示服务地址,可用于直接启动项目
  57. //target: 'https://saber.bladex.vip/api',
  58. ws: true,
  59. // pathRewrite: {
  60. // '^/testapi': '/'
  61. // }
  62. },
  63. '/vcDevice': {
  64. //本地服务接口地址
  65. target: 'http://localhost:2007',
  66. //远程演示服务地址,可用于直接启动项目
  67. //target: 'https://saber.bladex.vip/api',
  68. ws: true,
  69. // pathRewrite: {
  70. // '^/testapi': '/'
  71. // }
  72. },
  73. }
  74. }
  75. };