Skip to content

Public files not served from subdirectory in development #5262

Closed
@adueck

Description

@adueck

I am developing an app which I am deploying from a subdirectory.

In my package.json I have included "homepage": "https://example.com/my-subdirectory" and everything works great for deployment.

The only problem is when developing, my public folder assets get served from http://localhost:3000/ and not http://localhost:3000/my-subdirectory/.

Because I am using react-router and also doing some fetching and reading from resources in the public directory I do need to use the sub-directory in the urls, and so I need to modify some of my code while developing, and then again when deploying.

It would be wonderful if the public assets could be served from http://localhost:3000/subdirectory/ when there is "homepage": "https://example.com/subdirectory" in package.json.

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