gpt4 book ai didi

reactjs - github 页面显示自述文件,而不是index.js

转载 作者:行者123 更新时间:2023-12-03 14:19:44 26 4
gpt4 key购买 nike

我有一个基本的 React 应用程序。没有后端。我想在 github 页面上设置它。我看了这篇文章两次。 https://medium.freecodecamp.org/surge-vs-github-pages-deploying-a-create-react-app-project-c0ecbf317089

这两次,Github Pages 都会显示 README.md 文件,而不是我的公共(public)文件夹中的 index.html 文件。这是应用程序的文件目录的图像。有什么想法吗?

enter image description here如果重要的话,这是我在 package.json 中的内容:

{
"name": "react-blog",
"version": "0.1.0",
"private": true,
"homepage": "https://jackseabolt.github.io/react-blog/",
"dependencies": {
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-scripts": "1.0.14"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"predeploy": "npm run build",
"deploy" : "npm run build&&gh-pages -d build"
},
"devDependencies": {
"gh-pages": "^1.0.0"
}
}

最佳答案

您的问题可能是您使用主分支作为源。在 Github 项目页面的设置选项卡中,将源更改为使用 gh-pages 分支。

参见https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#step-4-ensure-your-projects-settings-use-gh-pages

关于reactjs - github 页面显示自述文件,而不是index.js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46595320/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com