fix(static): url encoded name included in generated ext - #340
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #340 +/- ##
==========================================
- Coverage 59.36% 58.81% -0.56%
==========================================
Files 26 26
Lines 598 607 +9
Branches 149 190 +41
==========================================
+ Hits 355 357 +2
- Misses 243 250 +7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
An alternative solution for this is to loop over a list of known good formats ('.png', .jpg') and use '.startsWith()' on the ext string. |
|
Thanks for PR @btkostner. I've added a refactor to pass original |
|
@pi0 Looks good! I wasn't sure how to add a test for this, but doing |
|
Thanks for confarming. Will trigger release after adding few more fixes. |
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
This fixes an issue with the static provider on remote domains including query params in the
nuxt generatefilename outputs.Example
Say I have
domains: ['https://images.prismic.io']in my nuxt config and passing an src likehttps://images.prismic.io/blog-system76/30e9de39-20a6-4caf-8728-0ec917942a0f_tumblr_4fef1ab602684355ef9596a0b9fdb122_810bfad7_1280.png?auto=compress,format&rect=56,0,700,700&w=800&h=800, the generated nuxt image file path would end up looking likedist/_nuxt/image/181d93.png%3Fauto=compress,format&rect=56,0,700,700&w=800&h=800.This PR changes it to output
dist/_nuxt/image/181d93.pngby stripping anything after%3Fwhich is the url encoded?