vue.config.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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://free.liaoningdoupo.com', ///api/train
  39. changeOrigin: true,
  40. ws: true,
  41. },
  42. '/files': {
  43. target: 'http://free.liaoningdoupo.com',
  44. changeOrigin: true,
  45. ws: true,
  46. },
  47. '/ws': {
  48. target: 'http://free.liaoningdoupo.com',
  49. ws: true,
  50. },
  51. '/weixin': {
  52. target: 'http://smart.cc-lotus.info',
  53. changeOrigin: true,
  54. ws: true,
  55. },
  56. '/jh': {
  57. //聚合科技API
  58. target: 'http://v.juhe.cn',
  59. changeOrigin: true,
  60. ws: true,
  61. pathRewrite: {
  62. '^/jh': '',
  63. },
  64. },
  65. },
  66. },
  67. };