vue.config.js 792 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. module.exports = {
  2. lintOnSave: true,
  3. productionSourceMap: false,
  4. chainWebpack: (config) => {
  5. //忽略的打包文件
  6. config.externals({
  7. 'vue': 'Vue',
  8. 'vue-router': 'VueRouter',
  9. 'vuex': 'Vuex',
  10. 'axios': 'axios',
  11. 'element-ui': 'ELEMENT',
  12. })
  13. const entry = config.entry('app')
  14. entry
  15. .add('babel-polyfill')
  16. .end()
  17. entry
  18. .add('classlist-polyfill')
  19. .end()
  20. entry
  21. .add('@/mock')
  22. .end()
  23. },
  24. devServer: {
  25. port: 1888,
  26. proxy: {
  27. '/api': {
  28. //本地服务接口地址
  29. target: 'http://localhost',
  30. //远程演示服务地址
  31. //target: 'https://saber.bladex.vip/api',
  32. ws: true,
  33. pathRewrite: {
  34. '^/api': '/'
  35. }
  36. }
  37. }
  38. }
  39. }