fix(dev): Register static assets without identifier for relative src paths#7502
Draft
MitchLillie wants to merge 1 commit intomainfrom
Draft
fix(dev): Register static assets without identifier for relative src paths#7502MitchLillie wants to merge 1 commit intomainfrom
MitchLillie wants to merge 1 commit intomainfrom
Conversation
476f4ae to
85f9b3b
Compare
Static assets were registered at target/identifier/file (e.g., target/assets/file), but relative paths like src='./cat.png' resolve to target/file. Changes: 1. Dev server: Register assets at target/file instead of target/identifier/file 2. Deploy: Add destination: 'assets' so assets copy to assets/ subdirectory Fixes #5285
85f9b3b to
8791cd8
Compare
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.
Summary
Static assets in UI extensions weren't resolving correctly when using relative paths like
src='./cat.png'.Root Cause
Assets were registered at
target/identifier/file(e.g.,target/assets/Shoe1.png), but relative paths likesrc='./Shoe1.png'resolve totarget/Shoe1.png.Changes
Dev server
Register assets at
target/fileinstead oftarget/identifier/file:Deploy
Add
destination: 'assets'to theinclude_assetsstep so files are copied toassets/subdirectory with correct manifest paths.Note
A corresponding server-side fix is needed to use the full manifest paths when constructing CDN URLs.
Fixes #5285