remot -v
- Change the
remote
of your current projectgit remote set-url origin https://github.com/your-username/your-repo-name.git
. git push origin master
.
Add a file, _redirects
(no file extension) to your public
directory.
This file should contain the redirect rule: /* /index.html 200
.
This is telling Netlify "if a request comes in to any endpoint on our base url - serve our index.html page and give a 200 status".
We put this in the public
directory to ensure that Webpack includes this file in the production build of the app.
npm run build
This script uses Webpack and Babel to "bundle" your code into a few uglified files that can be read by most modern browsers. Take a look inside - but don't change anything.
npm install netlify-cli -g
netlify deploy
- Authorise Netlify with GitHub, following the prompts in the browser.
- Select
Create & configure a new site
. - Provide your choice of site name.
- Select your personal account.
- Provide a deploy path. This needs to point to your build directory and should be
./build
.
Your draft version should now be deployed on a url, e.g. https://5c13ab16055b9be1725868e6--your-site-name.netlify.com
.
Test it out, make sure that everything is working as expected.
netlify deploy --prod
Specify your build path again.
This will deploy the site to your actual url: https://your-site-name.netlify.com
.