-
-
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: reacts urlForAssets loading non js,css files #1554
Fix: reacts urlForAssets loading non js,css files #1554
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1554 +/- ##
=========================================
+ Coverage 20.82% 20.9% +0.07%
=========================================
Files 251 251
Lines 5579 5583 +4
Branches 669 678 +9
=========================================
+ Hits 1162 1167 +5
+ Misses 3903 3900 -3
- Partials 514 516 +2
Continue to review full report at Codecov.
|
Does this change not also affect the vue app? |
The issue is present in the Vue app too, having just looked it it. Looks like the same code in app/vue/.../iframe.html.js. As for how to proceed with this PR, would you like to see that change there, an approach to share the code, or just to get this into the react app? |
Copy the fix into the vue code sounds like the best course of action for now. Yes I know this feels bad. It's a conscious choice to duplicate this code, and I knew there would be some pains because of it. But we know where the duplication really hits us and with the angular work we'll know much better what we should abstract into common bits and what we shouldn't. |
Totally understand @ndelangen. Added the code in the view app in 6908619. |
Just wanted to let you guys know that I also have hit the same issue. Is there anything missing for this MR to land? @ianmcnally is there any quick workaround for this issue? |
Verified by adding a svg-file as additional entrypoint in a custom webpack config. |
@ianmcnally I installed from git pointing to that commit, but I can't specify the subdirectory (app/react). Any alternative way to install?
|
You can specify it when importing: |
The issue is that when installing from git:
Here's my package.json devDependencies:
I'm using npm5. Using npm4, the package installs but Thanks. |
Indeed this is not possible. This feature has been requested but npm has shown 0 interest in adding it. |
We will release to npm soon! |
Should be on npm! |
Issue: when building a non css or js file with webpack, storybook would throw the error:
What I did
I added a webpack plugin to build an external svg.
That produced an assets bundle:
Which the logic in iframe.html.js fails to consider any extension beyond what it's define (
js
,css
).How to test
Include a non css or non js file in your webpack bundle. Or you could rename something generated by extract text webpack plugin to something non js or css.