Closed kylegach closed 2 years ago
@winkerVSbecks — Any idea what's up with Netlify? Looks like it's been failing in the same way quite often, but it sometimes works? 🤷♂️
Hmm... this is trickier than I first thought. The distributed files do not contain the svg files in src/images
, which are referenced by PageFooter. Apparently (I did some searching), prior to PageFooter, all svg files in that directory were only referenced in story files, so it hasn't been an issue until I attempted to distribute that component.
Ahh, I think I see now. They're used like this:
import RepoSVG from '../../../images/colored-icons/repo.svg';
<img src={RepoSVG} alt="Docs" />
Which works within Storybook, because Webpack transforms RepoSVG
into the proper string. But our package is only built with Babel, not Webpack, so none of that bundling is happening.
Going to have to think about the best way to move forward...
@kylegach perhaps convert it into JSX https://svg2jsx.com/
@kylegach perhaps convert it into JSX https://svg2jsx.com/
Yeah, that's what I ended up doing, but in an automated way via https://react-svgr.com/docs/cli/.
This is truly ready for review now. I confirmed it via canary install in my local project.
:rocket: PR was released in v7.1.0
:rocket:
📦 Published PR as canary version:
7.0.4-canary.322.4411ee0.0
:sparkles: Test out this PR locally via: ```bash npm install @storybook/design-system@7.0.4-canary.322.4411ee0.0 # or yarn add @storybook/design-system@7.0.4-canary.322.4411ee0.0 ```