Deploying react app to github pages5/21/2023 ![]() The commands shown in the following steps can all be issued from within the app's folder, so make sure to navigate to the newly created test folder and then use the commands. Install the gh-pages package as a "dev-dependency" of the app. This will create a new folder named test (or whatever you named your app) on your computer. you can name your app app-123 and your GitHub Repository repo-456). However, you can name them differently from one another (e.g. I opted to give the app the same name as my GitHub repository (i.e. This is the app you will deploy to GitHub Pages in step 7. gitignore file, a LICENSE file, or any other files. path/to/node_modules/.bin/create-react-app).Ī command-line Git client setup according to GitHub.įor this tutorial, I'll create a repository named test.īy empty, I mean without a README.md file, a. If you choose the latter, you will have to specify its path whenever you invoke it (e.g. $ npm install -g create-react-app) or install it locally (i.e. In the case of create-react-app, you can either install it globally (i.e. Here's the adequate version I use:Īn adequate version of create-react-app is installed. Here's the adequate version I use:Īn adequate version of npm is installed. The remainder of this document contains a tutorial on creating a React app (using create-react-app) and deploying that app to GitHub Pages.Īn adequate version of Node.js is installed. the code that GitHub Pages serves to the app's visitors). The master branch contains the app's source code (the code the app's developers edit), and the gh-pages branch contains a built version of the app (i.e. This repository contains the files related to the app. In this tutorial, I'll show you how I deployed a React app-which I created using create-react-app to GitHub Pages.
0 Comments
Leave a Reply. |