vue.config.js 728 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // 基础路径 注意发布之前要先修改这里
  2. let url = 'http://localhost:8800'
  3. module.exports = {
  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. proxy: {
  28. '/api': {
  29. target: url,
  30. ws: true,
  31. pathRewrite: {
  32. '^/api': '/'
  33. }
  34. }
  35. }
  36. }
  37. }