fix!: prepend router base - #339
Merged
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## main #339 +/- ##
==========================================
- Coverage 58.81% 58.71% -0.10%
==========================================
Files 26 26
Lines 607 608 +1
Branches 190 192 +2
==========================================
Hits 357 357
- Misses 250 251 +1
Continue to review full report at Codecov.
|
pi0
reviewed
Jun 29, 2021
Contributor
Author
|
Sorry about the force push. I accidentally merged in |
Closed
procrates
pushed a commit
to procrates/nuxt-image
that referenced
this pull request
Feb 21, 2023
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes #338 but is a breaking change due to how URLs are handled.
If you have a default router base of
/:/images/test.pngpoints to~/static/images/test.pngand outputs/_nuxt/image/hash.pngin the HTML (no difference.)If you have a router base of
/app/:/images/test.pngpoints to~/static/images/test.pngand would output/app/_nuxt/image/hash.pngin the HTML. This is different from the current implementation that would require you to do/app/images/test.pngto generate correctly.If you have a router base of
/app/with external url:https://example.com/test.pngpoints to an external URL and outputs/app/_nuxt/image/hash.pngin the HTML.Alternative way to do this
We could remove the changes in
ipx.ts. Specifying thesrcfor images would be the same as it is now, but it would resolve correctly after being built. This would not be a breaking change.