React Boilerplate CRA Template
  • README
  • Quick Start
  • Understanding react-boilerplate
  • Tools
    • CLI & Scaffolding
    • Editor Configuration
    • Package Managers
  • Building Blocks
    • Building Blocks
    • The Slice
      • Redux & Toolkit
      • Reselect
      • Redux-Saga
      • Redux Injectors
    • Async Components
    • Routing
    • i18n Internationalization & Pluralization
    • Styling (CSS)
    • Testing
  • Deployment
    • AWS
    • Azure
    • Heroku
    • Netlify
  • Misc
    • FAQ
Powered by GitBook
On this page

Was this helpful?

  1. Deployment

Netlify

PreviousHerokuNextFAQ

Last updated 4 years ago

Was this helpful?

Easy 5-Step Deployment Process

Step 1: Create a netlify.toml file in the root directory of your project and copy this code below. Edit these settings if you did not follow the boilerplate structure. More settings available here ()

[build]
  # Directory to change to before starting a build.
  # This is where we will look for package.json/.nvmrc/etc.
  base = "/"

  # Directory (relative to root of your repo) that contains the deploy-ready
  # HTML files and assets generated by the build. If a base directory has
  # been specified, include it in the publish directory path.
  publish = "./build"

  # Default build command.
  command = "yarn run build"

# The following redirect is intended for use with most SPAs that handle routing internally.
[[redirects]]
  from = "/*"
  to = "/index.html"
  status = 200

Step 2: Commit your code and push your latest updates to a GitHub repository.

Step 4: In your account | team page click New site from git then chose your repository.

Step 5: Click deploy.

Note: No need to change any setting in the last step as netlify.toml overwrites these settings.

Now your code will be deployed automatically to Netlify on every push to the default branch of your repository.🥳🥳

Step 3: Register or Login in at .

https://docs.netlify.com/configure-builds/file-based-configuration/#sample-file
Netlify