vue.config.js 926 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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
  17. .add('babel-polyfill')
  18. .end()
  19. entry
  20. .add('classlist-polyfill')
  21. .end()
  22. entry
  23. .add('@/mock')
  24. .end()
  25. },
  26. devServer: {
  27. port: 1888,
  28. proxy: {
  29. '/api': {
  30. //本地服务接口地址
  31. // target: 'http://localhost',
  32. //远程演示服务地址 其实官方已经提供了 让vue项目跑起来的服务器连接,好多人不知道这个
  33. target: 'https://saber.bladex.vip/api',
  34. ws: true,
  35. pathRewrite: {
  36. '^/api': '/'
  37. }
  38. }
  39. }
  40. }
  41. }