vue.config.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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.19:9002`,
  24. // target: `http://192.168.0.78:9002`,
  25. // target: `https://test.yuemeikang.com/prod-api`, // 测试环境
  26. // target: `https://app.yuemeikang.com/prod-api`, // 正式环境
  27. changeOrigin: true,
  28. pathRewrite: {
  29. ['^' + '/prod-api']: ''
  30. }
  31. },
  32. "/api": {
  33. target: `http://192.168.0.151:9001`,
  34. // target: `http://192.168.0.78:9001`,
  35. // target: `https://test.yuemeikang.com/prod-api`, // 测试环境
  36. // target: `https://app.yuemeikang.com/prod-api`, // 正式环境
  37. changeOrigin: true,
  38. pathRewrite: {
  39. ['^' + '/api']: '/api'
  40. }
  41. }
  42. }
  43. },
  44. css: {
  45. loaderOptions: {
  46. sass: {
  47. sassOptions: { outputStyle: "expanded" }
  48. }
  49. }
  50. }
  51. })