简体   繁体   English

build/index.html 是否可以用作没有服务器的独立网页?

[英]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.

相关问题 Webpack 服务未将 JS 插入索引。html - Webpack Serve not inserting JS into index.html 使用 webpack 构建 index.html 以与开发服务器一起使用 - Build index.html with webpack to use with dev server 骨干.js应用程序的服务器端(由REST API服务器提供index.html) - server side for backbone.js application( serve index.html by rest api server) grunt-serve 不提供带有“/”请求的 index.html - grunt-serve doesn't serve index.html with '/' request 我正在使用create-react-app,需要在没有服务器的情况下直接在浏览器中打开build / index.html - I'm using create-react-app and I need to open build/index.html in browser directly without a server 由于路径相对性问题,无法从快递服务器提供angular 2 index.html文件 - Cannot serve angular 2 index.html file from express server due to path relativity issue 如果我在同一来源提供 index.html,则服务器发送的事件(sse)中不会触发“关闭”事件 - "close" event did not fire in server sent events(sse) if i serve the index.html in the same origin 使用react + react-router-dom获取PHP服务器以为所有路由提供index.html - Get php server to serve index.html for all routes using react + react-router-dom Ubuntu服务器不将外部文件链接到index.html - Ubuntu server does not link external files to index.html 服务工作者不会在'/'上缓存golang服务器提供的index.html - Service worker does not cache index.html served by golang server on '/'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM