vue.config.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // let targetUrl = 'http://47.99.212.176:8000'
  2. let targetUrl = 'http://192.168.3.8:9001'
  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: 9001,
  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. '/student-server': {
  25. target: targetUrl,
  26. changeOrigin: true,
  27. ws: true,
  28. '^/student-server': '/student-server',
  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. '/order': {
  39. target: targetUrl,
  40. changeOrigin: true,
  41. ws: true,
  42. '^/order': '/order',
  43. xfwd: true
  44. }
  45. }, // string | Object
  46. },
  47. css: {
  48. loaderOptions: {
  49. less: {
  50. modifyVars: {
  51. // red: '#03a9f4',
  52. blue: '#14928A',
  53. // orange: '#f08d49',
  54. // 'text-color': '#111'
  55. }
  56. }
  57. }
  58. },
  59. }