vue.config.js 823 B

1234567891011121314151617181920212223242526272829303132
  1. const path = require('path');
  2. module.exports = {
  3. publicPath: process.env.NODE_ENV === 'development' ? '/' : process.env.VUE_APP_ROUTER,
  4. configureWebpack: config => {
  5. Object.assign(config, {
  6. // 开发生产共同配置
  7. resolve: {
  8. alias: {
  9. '@': path.resolve(__dirname, './src'),
  10. '@c': path.resolve(__dirname, './src/components'),
  11. '@a': path.resolve(__dirname, './src/assets'),
  12. },
  13. },
  14. });
  15. },
  16. devServer: {
  17. port: '8001',
  18. //api地址前缀
  19. proxy: {
  20. '/api': {
  21. target: 'http://smart.cc-lotus.info',
  22. ws: true,
  23. onProxyReq(proxyReq, req, res) {
  24. proxyReq.setHeader('x-tenant', '99991');
  25. },
  26. '/files': {
  27. target: 'http://free.liaoningdoupo.com',
  28. },
  29. },
  30. },
  31. },
  32. };