vue.config.js 2.1 KB

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