vue.config.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. const path = require('path');
  2. module.exports = {
  3. publicPath: process.env.NODE_ENV === 'development' ? './' : process.env.VUE_APP_ROUTER,
  4. pages: {
  5. index: 'src/pages/index/main.js',
  6. jobfairList: 'src/pages/jobfairList/main.js',
  7. jobinfoList: 'src/pages/jobinfoList/main.js',
  8. jobsList: 'src/pages/jobsList/main.js',
  9. talkList: 'src/pages/talkList/main.js',
  10. jobfair: 'src/pages/jobfair/main.js',
  11. jobinfo: 'src/pages/jobinfo/main.js',
  12. jobs: 'src/pages/jobs/main.js',
  13. talk: 'src/pages/talk/main.js',
  14. student: 'src/pages/student/main.js',
  15. corp: 'src/pages/corp/main.js',
  16. news: 'src/pages/news/main.js',
  17. register: 'src/pages/register/main.js',
  18. newsList: 'src/pages/newsList/main.js',
  19. },
  20. configureWebpack: config => {
  21. Object.assign(config, {
  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. },
  29. },
  30. });
  31. },
  32. // css: {
  33. // loaderOptions: {
  34. // css: {
  35. // data: `@import "./src/style/nutui.css";@import "@nutui/nutui/dist/styles/index.css";`,
  36. // },
  37. // },
  38. // },
  39. devServer: {
  40. port: '8005',
  41. //api地址前缀
  42. proxy: {
  43. '/api': {
  44. target: 'http://smart.cc-lotus.info',
  45. ws: true,
  46. onProxyReq(proxyReq, req, res) {
  47. proxyReq.setHeader('x-tenant', 'master');
  48. },
  49. },
  50. '/wxtoken': {
  51. target: 'http://smart.cc-lotus.info/weixin',
  52. changeOrigin: true,
  53. ws: true,
  54. pathRewrite: {
  55. '^/wxtoken': 'http://localhost:8104',
  56. },
  57. },
  58. '/files': {
  59. target: 'http://smart.cc-lotus.info',
  60. changeOrigin: true,
  61. ws: true,
  62. },
  63. },
  64. },
  65. };