patternfly / patternfly/patternfly-react-seed

Can't find fonts when serving from a non-root path

Open
#126 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
97
Forks
282
PR merge metrics
No merged PRs in 30d

Description

Use case is to take the files generated in dist/ and put them on a webserver in a non-root path.

The error I encounter when doing this is that the patternfly fonts, specified in the main.css use a url(/fonts/...) path, which forces the browser to look at the root, rather than relative to the base path.

Is there anyway to update webpack to change this?


Jira Issue: PF-2028

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the webpack configuration and the generated files in dist/, especially dist/main.css and its font URLs. Reproduce serving the output from a non-root path, then trace how webpack emits the PatternFly font paths. Done means the generated CSS resolves those fonts correctly under a non-root base path.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript, webpack
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.