vue.config.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * @Author: DSH
  3. * @LastEditors: DSH
  4. */
  5. module.exports = {
  6. //路径前缀
  7. publicPath: "/",
  8. lintOnSave: true,
  9. productionSourceMap: false,
  10. chainWebpack: (config) => {
  11. //忽略的打包文件
  12. config.externals({
  13. 'vue': 'Vue',
  14. 'vue-router': 'VueRouter',
  15. 'vuex': 'Vuex',
  16. 'axios': 'axios',
  17. 'element-ui': 'ELEMENT',
  18. });
  19. const entry = config.entry('app');
  20. entry.add('babel-polyfill').end();
  21. entry.add('classlist-polyfill').end();
  22. entry.add('@/mock').end();
  23. },
  24. css: {
  25. extract: {
  26. ignoreOrder: true
  27. }
  28. },
  29. //开发模式反向代理配置,生产模式请使用Nginx部署并配置反向代理
  30. devServer: {
  31. port: 20002,
  32. proxy: {
  33. '/api': {
  34. //本地服务接口地址
  35. target: 'http://localhost:50004',
  36. //远程演示服务地址,可用于直接启动项目
  37. //target: 'http://111.204.228.227:20002',
  38. ws: true,
  39. pathRewrite: {
  40. '^/api': '/'
  41. }
  42. },
  43. '/oss/galaxy': {
  44. target: 'https://wx.dahengsi.com:44301',
  45. },
  46. '/file/download': {
  47. target: 'https://wx.dahengsi.com:44301',
  48. }
  49. }
  50. }
  51. };