vue.config.js 2.2 KB

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