-
Notifications
You must be signed in to change notification settings - Fork 270
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(static): url encoded name included in generated ext #340
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
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 generate
filename 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.png
by stripping anything after%3F
which is the url encoded?