vue.config.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. },
  19. configureWebpack: config => {
  20. Object.assign(config, {
  21. // 开发生产共同配置
  22. resolve: {
  23. alias: {
  24. '@': path.resolve(__dirname, './src'),
  25. '@c': path.resolve(__dirname, './src/components'),
  26. '@a': path.resolve(__dirname, './src/assets'),
  27. },
  28. },
  29. });
  30. },
  31. // css: {
  32. // loaderOptions: {
  33. // css: {
  34. // data: `@import "./src/style/nutui.css";@import "@nutui/nutui/dist/styles/index.css";`,
  35. // },
  36. // },
  37. // },
  38. devServer: {
  39. port: '8005',
  40. //api地址前缀
  41. proxy: {
  42. '/api': {
  43. target: 'http://smart.cc-lotus.info',
  44. ws: true,
  45. onProxyReq(proxyReq, req, res) {
  46. proxyReq.setHeader('x-tenant', '99991');
  47. },
  48. },
  49. '/wxtoken': {
  50. target: 'http://smart.cc-lotus.info/weixin',
  51. changeOrigin: true,
  52. ws: true,
  53. pathRewrite: {
  54. '^/wxtoken': 'http://localhost:8005',
  55. },
  56. },
  57. '/files': {
  58. target: 'http://smart.cc-lotus.info',
  59. changeOrigin: true,
  60. ws: true,
  61. },
  62. },
  63. },
  64. };