Skip to content

deploying to github pages as subdirectory #478

Closed
@stopachka

Description

@stopachka

I have a small project with create-react-app, which I wanted to host on github pages. It would be:

stopachka.github.io/my-project

The help in our tutorial was awesome. However, when loading the project, assets are not correctly found.

In the generated index.html, we have ->

<script type="text/javascript" src="/static/js/main.ce66e420.js"></script>

This will direct github-pages too

https://stopachka.github.io/static/js/main.ce66e420.js

which return a 400. It should instead direct to ->

stopachka.github.io/my-project/static/js/main.ce66e420.js

Ideas:

  1. Make it so the source path does not have the / prepended to it.
  2. Find simple way to tell github-pages to do the right thing, or to prepend /my-project/ to the source path through some option
  3. If this is something that we don't want to support out of the box, we can tell users to eject, and write some quick instructions in the docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions