vue.config.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. const {
  2. defineConfig
  3. } = require('@vue/cli-service')
  4. module.exports = defineConfig({
  5. lintOnSave: false, // 关闭警告提醒
  6. transpileDependencies: true,
  7. publicPath: '/h5',
  8. chainWebpack: config => {
  9. // 配置网页标题
  10. config.plugin('html').tap((args) => {
  11. args[0].title = '详情'
  12. return args
  13. })
  14. },
  15. devServer: {
  16. host: '0.0.0.0',
  17. port: '8080',
  18. open: true,
  19. proxy: {
  20. // detail: https://cli.vuejs.org/config/#devserver-proxy
  21. "/prod-api": {
  22. target: `http://192.168.0.151:9002`,
  23. // target: `http://192.168.0.78:9002`,
  24. // target: `https://test.yuemeikang.com/prod-api`, // 测试环境
  25. // target: `https://app.yuemeikang.com/prod-api`, // 正式环境
  26. changeOrigin: true,
  27. pathRewrite: {
  28. ['^' + '/prod-api']: ''
  29. }
  30. },
  31. "/api": {
  32. target: `http://192.168.0.151:9001`,
  33. // target: `http://192.168.0.78:9001`,
  34. // target: `https://test.yuemeikang.com/prod-api`, // 测试环境
  35. // target: `https://app.yuemeikang.com/prod-api`, // 正式环境
  36. changeOrigin: true,
  37. pathRewrite: {
  38. ['^' + '/api']: '/api'
  39. }
  40. }
  41. }
  42. },
  43. css: {
  44. loaderOptions: {
  45. sass: {
  46. sassOptions: { outputStyle: "expanded" }
  47. }
  48. }
  49. }
  50. })