react-styleguidist
react-styleguidist copied to clipboard
Wrong assets path on build
Hi, I'm facing an issue. On dev the assets are working great but when I run the build the path of assets is wrong.
the final path is: build/styleguide/static/css/static/media/ico_error.7083826e.svg
build should be build/styleguide/static/media/ico_error.7083826e.svg
This error is occurring on all my assets, icons, and fonts.
I guess I'm glad I'm not the only one. I tried to read through the documentation to see if something was misconfigured, but nothing obvious is missing.
Either of you find a fix for this? Running into same issue with the path to fonts.
Kind of. I manually copied the assets that were compiled into the directory it was looking in. If you make any asset changes, you'll have to perform this manual step again.
An easier workaround is to manually set publicPath in the utilized webpack config:
dangerouslyUpdateWebpackConfig(webpackConfig, env) {
if (!webpackConfig.output.publicPath) {
webpackConfig.output.publicPath = "/";
}
return webpackConfig;
},
Relative paths in styleguidist server and build for fonts src referrals in the css are broken and are missing a slash. url(static/media/...
needs to be url(/static/media...
. React build and react serve works as expected with the correct relative paths. My styleguidist.cofig.js does not include any path configuration so it should be the same as the React app, correct? What exactly needs to be updated in the styleguidist.cofig.js to fix this? Thanks a lot!
😴 This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week without any further activity. Consider opening a pull request if you still have this issue or want this feature.
@stefan-jonasson thank you so much for your suggestion. I love styleguidist but i have been fighting that weird asset path inside the css 😢
😴 This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week without any further activity. Consider opening a pull request if you still have this issue or want this feature.