我运行了npm run build
,成功创建了Dist
文件夹,现在打开index.html抛出错误:无法加载资源:net::ERR_FILE_NOT_FOUND
这里可能出现什么问题?
最佳答案
我发现添加了
module.exports = {
publicPath: './'
};
to vue.config.js
也解决了这个问题,之后我们可以直接从 dist
文件夹中打开 index.html
。
有关 docs 中的 publicPath
的更多信息.
关于javascript - 我通过运行 npm run build 构建了我的 Vuejs 应用程序,打开 index.html 抛出错误: 无法加载资源:net::ERR_FILE_NOT_FOUND,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61257941/