vue.config.js 837 B

1234567891011121314151617181920212223242526272829303132333435
  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. }
  23. // productionSourceMap: false,
  24. // devServer: {
  25. // proxy: {
  26. // '/test': {
  27. // target: "http://47.105.143.227:3000",//这个是你要访问的接口地址
  28. // changeOrigin: true,
  29. // pathRewrite: {//重写地址 比如说 你的接口地址是'https://188.62.63/xxyy/getUser' 你请求得时候地址只需要写'/test/getUser'
  30. // '/test': '/xxyy'
  31. // }
  32. // }
  33. // }
  34. // }
  35. }