vue.config.js 1014 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. const path = require('path');
  2. const common = path.resolve(__dirname, '../frame-template/src');
  3. module.exports = {
  4. publicPath: process.env.NODE_ENV === 'development' ? '/' : process.env.VUE_APP_ROUTER,
  5. outputDir: 'www',
  6. configureWebpack: config => {
  7. Object.assign(config, {
  8. // 开发生产共同配置
  9. resolve: {
  10. alias: {
  11. '@': path.resolve(__dirname, './src'),
  12. '@c': path.resolve(__dirname, './src/components'),
  13. '@a': path.resolve(__dirname, './src/assets'),
  14. '@plugins': path.join(common, '/plugins'),
  15. '@common': common,
  16. },
  17. },
  18. });
  19. },
  20. devServer: {
  21. port: '8001',
  22. //api地址前缀
  23. proxy: {
  24. '/api': {
  25. target: 'http://broadcast.waityou24.cn', //http://free.liaoningdoupo.com
  26. ws: false,
  27. },
  28. '/mobile': {
  29. target: 'http://broadcast.waityou24.cn',
  30. ws: false,
  31. },
  32. '/files': {
  33. target: 'http://broadcast.waityou24.cn',
  34. },
  35. },
  36. },
  37. };