vue.config.js 833 B

123456789101112131415161718192021222324252627
  1. const { defineConfig } = require('@vue/cli-service')
  2. module.exports = defineConfig({
  3. transpileDependencies: true,
  4. outputDir: 'dist',
  5. // 使用相对路径,便于将 dist 放入 Android assets 以 file:// 打开;同目录部署的 Spring 静态页也兼容
  6. publicPath: process.env.VUE_APP_PUBLIC_PATH != null && process.env.VUE_APP_PUBLIC_PATH !== ''
  7. ? process.env.VUE_APP_PUBLIC_PATH
  8. : './',
  9. devServer: {
  10. // 明确监听所有网卡,避免部分环境下仅 IPv6/本机名解析导致 localhost 拒绝连接
  11. host: '0.0.0.0',
  12. port: 8080,
  13. proxy: {
  14. '/api': {
  15. target: 'http://localhost:3381',
  16. changeOrigin: true
  17. }
  18. }
  19. },
  20. chainWebpack: config => {
  21. config.plugin('html').tap(args => {
  22. args[0].title = '甘肃省中医院'
  23. return args
  24. })
  25. }
  26. })