vue.config.js 761 B

123456789101112131415161718192021222324252627282930313233343536
  1. const path = require('path')
  2. // const proxyObj = {}
  3. // proxyObj['/'] = {
  4. // target: 'http://localhost:8080',
  5. // changeOrigin: true,
  6. // pathRewrite: {
  7. // '^/': ''
  8. // }
  9. // }
  10. module.exports = {
  11. // 基本路径
  12. publicPath: './',
  13. // 输出文件目录
  14. outputDir: 'dist',
  15. configureWebpack: {
  16. externals: {
  17. }
  18. },
  19. devServer: {
  20. proxy: {
  21. '/api': {
  22. target: 'http://localhost:8080',
  23. changeOrigin: true,
  24. ws: true,
  25. pathRewrite: {
  26. '^/api': '/mock'
  27. }
  28. }
  29. },
  30. public: require('os').networkInterfaces()[Object.keys(require('os').networkInterfaces())[0]][1].address + ':8080',
  31. disableHostCheck: true
  32. // host: 'localhost',
  33. // port: 8080,
  34. // proxy: proxyObj
  35. }
  36. }