You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update storybook config to display USWDS images when deploying to a subdir (#98)
## Ticket
#97
## Changes
- Update regex for storybook string replacement to support deploying to
a subdirectory
## Context for reviewers
I deployed
#89 to WIC MT
Demo Project in order to get our storybook deployed using github pages.
I found an issue where the images weren't displaying properly and made a
PR for it:
navapbc/wic-mt-demo-project-eligibility-screener#168
This PR is a port of that one.
See also Slack discussion:
https://nava.slack.com/archives/C03G1SWD9H7/p1669820652173809
I inspected the [generated github action
artifact](https://github.com/navapbc/template-application-nextjs/actions/runs/3633298101)
and confirmed that we are currently correctly prepending the BASE_PATH
to any relative paths in storybook that begin with url(/. However, USWDS
also uses this syntax url("/ and our regex doesn't catch that.
## Testing
1. Go to [this github action run](), which builds storybook for this
branch and deploys it to github pages
2. Download the generated artifact
3. Unzip the artifact
4. Grep the unzipped files and confirm that `"/uswds/img` does not
appear and that `"template-application-nextjs/uswds/img` does appear
Co-authored-by: Sawyer Hollenshead <[email protected]>
0 commit comments