vue.config.js 820 B

1234567891011121314151617181920212223242526272829303132333435
  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: 1888,
  22. proxy: {
  23. '/api': {
  24. //本地服务接口地址
  25. target: 'http://localhost',
  26. //远程演示服务地址,可用于直接启动项目
  27. //target: 'https://saber.bladex.vip/api',
  28. ws: true,
  29. pathRewrite: {
  30. '^/api': '/'
  31. }
  32. }
  33. }
  34. }
  35. };