webpack请求文件路径代理

在开发模式下,访问页面请求会跑到根路径,因为写的都  ./images  而index又在根目录,

所以访问地址会是 http://localhost:8080/images/abc.jpg

 

 而实际文件地址应该是 http://localhost:8080/static/images/abc.jpg 

 

修改配置 /images 代表拦截这种请求
pathRewrite 表示将  /images 改为 /static/images

 

相关文章:

  • 2022-01-08
  • 2021-06-11
  • 2022-12-23
  • 2022-12-23
  • 2021-04-24
  • 2022-01-01
  • 2021-12-10
猜你喜欢
  • 2022-12-23
  • 2021-05-27
  • 2021-11-05
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
  • 2021-10-18
相关资源
相似解决方案