vue.config.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // let targetUrl = 'http://47.99.212.176:8000'
  2. let targetUrl = 'http://192.168.3.48:8000'
  3. module.exports = {
  4. // 调整内部的 webpack 配置。
  5. // 查阅 https://github.com/vuejs/vue-doc-zh-cn/vue-cli/webpack.md
  6. chainWebpack: () => {},
  7. configureWebpack: () => {},
  8. // 配置 webpack-dev-server 行为。
  9. devServer: {
  10. open: process.platform === 'darwin',
  11. host: '0.0.0.0',
  12. port: 9999,
  13. https: false,
  14. hotOnly: false,
  15. // 查阅 https://github.com/vuejs/vue-doc-zh-cn/vue-cli/cli-service.md#配置代理
  16. proxy: {
  17. '/contracts': {
  18. target: targetUrl,
  19. changeOrigin: true,
  20. ws: true,
  21. '^/contracts': '/contracts',
  22. xfwd: true
  23. },
  24. '/api-student': {
  25. target: targetUrl,
  26. changeOrigin: true,
  27. ws: true,
  28. '^/api-student': '/api-student',
  29. xfwd: true
  30. },
  31. '/api-cms': {
  32. target: targetUrl,
  33. changeOrigin: true,
  34. ws: true,
  35. '^/api-cms': '/api-cms',
  36. xfwd: true
  37. },
  38. '/api-teacher': {
  39. target: targetUrl,
  40. changeOrigin: true,
  41. ws: true,
  42. '^/api-teacher': '/api-teacher',
  43. xfwd: true
  44. },
  45. '/api-web': {
  46. target: targetUrl,
  47. changeOrigin: true,
  48. ws: true,
  49. '^/api-web': '/api-web',
  50. xfwd: true
  51. }
  52. }, // string | Object
  53. },
  54. css: {
  55. loaderOptions: {
  56. less: {
  57. modifyVars: {
  58. // red: '#03a9f4',
  59. blue: '#14928A',
  60. // orange: '#f08d49',
  61. // 'text-color': '#111'
  62. }
  63. }
  64. }
  65. },
  66. }