[英]Does build/index.html serve as a standalone webpage without server?
Does build/index.html generated after npm run build serve as a standalone webpage or does it only work with serve -s build.在 npm 运行 build 之后生成的 build/index.html 是作为独立网页使用还是仅与 serve -s build 一起使用。
index.html file returns blank page and on inspecting the page it shows: "main.17cbfec0.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND" index.html 文件返回空白页并在检查页面时显示: “main.17cbfec0.js:1 无法加载资源:net::ERR_FILE_NOT_FOUND”
You should serve the entire build
directory, not just specific files as the index.html
file relies on various JavaScript bundles generated by CRA, which are all located in that build
folder.您应该提供整个build
目录,而不仅仅是作为索引的特定文件index.html
文件依赖于 CRA 生成的各种 JavaScript 包,这些包都位于该build
文件夹中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.