vue项目打包后运行报错400如何解决

昨天一个Vue项目打包后,今天测试,发现无论localhost还是服务器上都运行不了,报错如下:


Failed to load resource: the server responded with a status of 400 (Bad Request)

网上搜索一圈,牛头不对马嘴的居多,向一前辈请教后,问题迎刃而解,现将方法分享如下:

其实超级简单!超级简单!超级简单!重要是事情说三遍,只需----------》

找到node_modules/@vue/cli-service/lib/options.js文件,将下图中81行的publicPath:'./'和83行的baseUrl:'./'   路径前面的(.)去掉即可!!

是不是so easy ??

原文地址:https://www.cnblogs.com/fxwoniu/p/11356269.html