vue.config.js 2.2 KB

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