vue项目 build 打包后访问不到页面 Failed to load resource: the server responded with a status of 404 (Not Found)

在项目打包发布的时候,build完成发出去根本访问不到页面报错Failed to load resource: the server responded with a status of 404 (Not Found) 通过多方查找最终定位除了问题 是路径的问题。

解决方式:找到config文件底下的index.js文件 build节点下 assetsPublicPath改为 assetsPublicPath: './' 相对路径 斜杠前面加一小点。
vue项目 build 打包后访问不到页面 Failed to load resource: the server responded with a status of 404 (Not Found)_第1张图片
这样重新打包就ok 了。

你可能感兴趣的:(vue)