Como faço pra rodar um react app no github pages? #7
Answered
by
marco-souza
Guilherme-BS
asked this question in
Perguntas e Respostas
-
|
No Exemplo o Github Pages não abre a aplicação so o readme do projeto. |
Beta Was this translation helpful? Give feedback.
Answered by
marco-souza
Jul 13, 2021
Replies: 1 comment
-
|
Para fazer isso precisamos de seguir algumas etapas:
Seque abaixo um exemplo de {
"name": "search-zip",
"homepage": "https://meu-user.github.io/meu-projeto/", // add
"version": "0.1.0",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"deploy": "npm run build && npx gh-pages -d build", // add
"test": "react-scripts test",
"eject": "react-scripts eject"
},
// ...
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Guilherme-BS
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Para fazer isso precisamos de seguir algumas etapas:
homepageaopackage.jsoncom o link da URL onde ele estará rodando, ex:https://myuser.github.io/my-repodeploynopackage.json->"deploy": "npm run build && npx gh-pages -d build"npm run deploysempre que quiser atualizar a aplicaçãoSeque abaixo um exemplo de
package.jsonjá com o script de deploy:{ "name": "search-zip", "homepage": "https://meu-user.github.io/meu-projeto/", // add "version": "0.1.0", "scripts": { "start": "react-scripts start", "build": "react-scripts build", "deploy": "npm run build && npx gh-pages -d build", // add "test": "react-scripts test", …