vue.config.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. const path = require('path');
  2. const frame = path.resolve(__dirname, '../frame');
  3. const school = path.resolve(__dirname, '../train-school');
  4. module.exports = {
  5. publicPath: process.env.NODE_ENV === 'development' ? '/' : '/center',
  6. outputDir: 'center',
  7. productionSourceMap: false,
  8. chainWebpack: config => {
  9. // if (process.env.NODE_ENV === 'production') {
  10. // config
  11. // .plugin('webpack-bundle-analyzer')
  12. // .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
  13. // .end();
  14. // config.plugins.delete('prefetch');
  15. // }
  16. },
  17. configureWebpack: {
  18. // externals: {
  19. // // 'element-ui': 'Element',
  20. // // vue: 'Vue',
  21. // },
  22. // 开发生产共同配置
  23. resolve: {
  24. alias: {
  25. '@': path.resolve(__dirname, './src'),
  26. '@c': path.resolve(__dirname, './src/components'),
  27. '@a': path.resolve(__dirname, './src/assets'),
  28. '@frame': frame,
  29. '@school': school,
  30. },
  31. },
  32. },
  33. devServer: {
  34. port: '8002',
  35. //api地址前缀
  36. proxy: {
  37. '/api/train': {
  38. target: 'http://broadcast.waityou24.cn', ///api/train http://free.liaoningdoupo.com http://jytz.jilinjobs.cn
  39. changeOrigin: true,
  40. ws: true,
  41. },
  42. '/api/auth': {
  43. target: 'http://broadcast.waityou24.cn', ///api/train http://free.liaoningdoupo.com http://jytz.jilinjobs.cn
  44. changeOrigin: true,
  45. ws: true,
  46. },
  47. '/api/mission': {
  48. target: 'http://broadcast.waityou24.cn', ///api/train http://free.liaoningdoupo.com http://jytz.jilinjobs.cn
  49. changeOrigin: true,
  50. ws: true,
  51. },
  52. // '/files': {
  53. // target: 'http://jytz.jilinjobs.cn',
  54. // changeOrigin: true,
  55. // ws: true,
  56. // },
  57. // '/ws': {
  58. // target: 'http://jytz.jilinjobs.cn', //http://free.liaoningdoupo.com
  59. // ws: true,
  60. // },
  61. // '/weixin': {
  62. // target: 'http://smart.cc-lotus.info',
  63. // changeOrigin: true,
  64. // ws: true,
  65. // },
  66. // '/jh': {
  67. // //聚合科技API
  68. // target: 'http://v.juhe.cn',
  69. // changeOrigin: true,
  70. // ws: true,
  71. // pathRewrite: {
  72. // '^/jh': '',
  73. // },
  74. // },
  75. },
  76. },
  77. };