Skip to content

Create React App

Create React App (often shortened to “CRA”) is the older, but still very common, way to make a React app. Here the folder you upload is called build (not dist).

The package.json mentions react-scripts, and the commands use react-scripts build.

  1. Open a terminal in the project folder.

  2. Install the pieces it needs (first time):

    Terminal window
    npm install
  3. Build:

    Terminal window
    npm run build

    A build folder appears.

  4. Upload the build folder to Bailey.

CRA uses absolute paths by default (ones starting with /). On a Bailey subdomain that’s fine, but if you hit a blank page, add this line to package.json:

package.json
{
"homepage": ".",
"name": "my-app"
}

"homepage": "." switches to relative paths. Run npm run build again and re-upload build. → Why your site looks broken

Hosted on Bailey