Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !11082

Add `homepage` example without the full domain

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Administrator requested to merge github/fork/camjackson/master into main Jun 08, 2021
  • Overview 4
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: camjackson

Consider 3 different possibilities for where an app will be deployed:

  1. Deploying to just a single domain and path (e.g. always example.com/my-app)
  2. Deploying to any arbitrary domain and path (e.g. example.com/my-app but also random.com/blah)
  3. Deploying to multiple domains but always the same path (e.g. example.com/my-app and test.example.com/my-app)

Scenario 1 is well-documented at "Deployment - Building for relative paths":

  "homepage": "http://mywebsite.com/relativepath",

Scenario 2 is well-documented at Deployment - Serving the Same Build from Different Paths, including the caveat that it breaks client-side routing:

  "homepage": ".",

Scenario 3 does not have a documented solution, despite it being the most common one in my experience. As far as I can tell, the following configuration works perfectly well:

  "homepage": "/my-app",

But after much searching I haven't seen anywhere on the internet that mentions the ability to specify homepage with just a path and no domain.

This PR adds that example to the docs. Here's how it looks:

Screen Shot 2021-06-09 at 8 54 20 am
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/camjackson/master