Skip to content

Fix: ui- rendering issue on Pr-preview link#7642

Open
saurabhraghuvanshii wants to merge 2 commits intolayer5io:masterfrom
saurabhraghuvanshii:Pr
Open

Fix: ui- rendering issue on Pr-preview link#7642
saurabhraghuvanshii wants to merge 2 commits intolayer5io:masterfrom
saurabhraghuvanshii:Pr

Conversation

@saurabhraghuvanshii
Copy link
Copy Markdown
Member

Description

gatsby-config.js

  • In CI, the workflow sets PATH_PREFIX to the folder segment where the preview will live (e.g. pr-preview/pr-5).
  • Gatsby reads pathPrefix: the leading / turns that into a path such as /pr-preview/pr-5.
  • With npm run build:preview (gatsby build --prefix-paths), Gatsby rewrites asset and page links so they start with that prefix (e.g. /pr-preview/pr-5/app-….js).
  • pathPrefix is only set when PATH_PREFIX is set, so a normal production build (no env var) stays a root deploy and is unchanged.

the workflow make the build which subpath the preview uses; gatsby-config.js applies that as pathPrefix so every script and style loads from the right place and the page can run as a full interactive app.

This PR fixes #

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Preview deployment: https://layer5io.github.io/layer5/pr-preview/pr-7642/

Note: Preview may take a moment (GitHub Pages deployment in progress). Please wait and refresh. Track deployment here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant