webpack请求文件路径代理

 

 

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

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

 

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

 

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

 

posted @ 2018-05-04 09:02  boyanh  阅读(1277)  评论(0编辑  收藏  举报