vue.config.js 953 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. const path = require('path')
  2. module.exports = {
  3. // 基本路径
  4. publicPath: './',
  5. // 输出文件目录
  6. outputDir: 'dist',
  7. configureWebpack: {
  8. externals: {
  9. }
  10. },
  11. devServer: {
  12. proxy: {
  13. '/api': {
  14. target: 'http://localhost:8080',
  15. changeOrigin: true,
  16. ws: true,
  17. pathRewrite: {
  18. '^/api': '/mock'
  19. }
  20. }
  21. },
  22. public: require('os').networkInterfaces()[Object.keys(require('os').networkInterfaces())[0]][1].address + ':8080',
  23. disableHostCheck: true
  24. }
  25. // productionSourceMap: false,
  26. // devServer: {
  27. // proxy: {
  28. // '/test': {
  29. // target: "http://47.105.143.227:3000",//这个是你要访问的接口地址
  30. // changeOrigin: true,
  31. // pathRewrite: {//重写地址 比如说 你的接口地址是'https://188.62.63/xxyy/getUser' 你请求得时候地址只需要写'/test/getUser'
  32. // '/test': '/xxyy'
  33. // }
  34. // }
  35. // }
  36. // }
  37. }