Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mohokh67
Last active November 19, 2018 07:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mohokh67/a21265c1a832583904719d97eb6a827a to your computer and use it in GitHub Desktop.
Save mohokh67/a21265c1a832583904719d97eb6a827a to your computer and use it in GitHub Desktop.
Deploy single page app with react to Netlify

Deploy single page app with react to Netlify

After installing the main package as we need it for deploy:

npm i netlify-cli -g

Build the app with this command:

npm run build

Create a file _redirects in build or dist directory

/*    /index.html   200

More info Here

Run this command and follow the instruction in command line

netlify deploy

It will ask to login (Only for the first time) and what directory needs to be deployed. In most cases build or dist directory. Depends on your project. Finally it will give you the link to project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment