Update storybook config to display USWDS images when deploying to a subdir #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ticket
#97
Changes
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 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
"/uswds/img
does not appear and that"template-application-nextjs/uswds/img
does appear