-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix css relative asset urls #4695
Fix css relative asset urls #4695
Conversation
// Options similar to the same options in webpackOptions.output | ||
// both options are optional | ||
filename: 'static/css/[name].[contenthash:8].css', | ||
chunkFilename: 'static/css/[name].[contenthash:8].chunk.css', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These settings were copied over from cra's webpack config. Since storybook does not have a dynamic publicPath
like cra, these are not needed. As mentioned in the storybook
config, relative urls always work.
I just tested this by manually applying the same fix and I confirm that CSS-imported images are shown now. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't understand the change but seems to fix the problem!
@shilman In CRA, they have a dynamic public path and a check to see if relative paths should be used. My original implementation copied over the CSS minification paths that didn't match up with the mini css loader. So this just gets those back in sync. Edit: Can you also add the |
Can you please update the snapshots? |
…-relative-asset-urls
@igor-dv Which test checks the snapshots? Everything either passes locally or fails on the Vue bugs in Master. |
Codecov Report
@@ Coverage Diff @@
## master #4695 +/- ##
=======================================
Coverage 35.59% 35.59%
=======================================
Files 557 557
Lines 6732 6732
Branches 884 884
=======================================
Hits 2396 2396
Misses 3876 3876
Partials 460 460
Continue to review full report at Codecov.
|
…storybook into fix-css-relative-asset-urls
Issue: resolves #4645
What I did
How to test
I tested both by adding a relative asset to the
cra-kitchen-sink
styles and built storybook for prod (yarn build-storybook).I also cloned @Vinnl's repo and testing the stories there.