vue.config.js 1.9 KB

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