-
Notifications
You must be signed in to change notification settings - Fork 93
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
Apply workaround for importing images via css #135 #139
Conversation
Codecov Report
@@ Coverage Diff @@
## master #139 +/- ##
=======================================
Coverage 90.90% 90.90%
=======================================
Files 13 13
Lines 176 176
Branches 41 41
=======================================
Hits 160 160
Misses 13 13
Partials 3 3
Continue to review full report at Codecov.
|
The maintainer of I've tested this fork by updating my "next-optimized-images": "ssh://github.com/aantthony/next-optimized-images#2b52cf5e4f32cb7a0d9b8b57f17727ea230af092", I then imported the same image in both JS and in my SCSS module. The one imported in JS does appear to get processed by So this definitely works as a workaround so importing images at least doesn't break (thanks @aantthony!) but it would be nice if there was a way to tell NextJS not to process images at all so we can just leave it up to |
Would love to see this one land! We forked and are using this in production to fix |
Thank you very much for all your inputs! Once the quick fix is released, I'll try to find a solution so that images in CSS can get optimized again. |
I just published the version I would be happy if you can test the published version in your project and report back in case there are still some issues. Thanks again for your contributions 👍 |
Thanks @cyrilwanner. The published version works for me 👍 |
So, I think that I was now able to overwrite the nextjs builtin image handling so |
Yep, it works. I checked an SVG file that was referenced via SCSS and confirmed it was indeed optimised. Thanks 👍 |
Upstream changes in Next broke image support in css as mentioned in #135
I've applied the changes from the workaround found by @theshem from vercel/next.js#11164 (comment)
It seems to work, although I don't understand why.