docs(website): use local sandbox URL for playground-elements#13075
Closed
docs(website): use local sandbox URL for playground-elements#13075
Conversation
Collaborator
|
🧹 Preview deployment cleaned up: https://pr-13075--ui5-webcomponents.netlify.app |
b2cb058 to
89c9ab3
Compare
Always set sandboxBaseUrl to the current origin instead of only in development mode. This makes playground-elements load its resources from local static files instead of unpkg.com CDN. This fixes a runtime error caused by webpack 5.105.0's changed handling of import.meta.url, which broke dynamic imports from external URLs.
89c9ab3 to
1dfde1e
Compare
Contributor
Author
|
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
Always set
sandboxBaseUrlto the current origin instead of only in development mode. This makes playground-elements load its resources from local static files instead of unpkg.com CDN.Problem
Webpack 5.105.0 (#13040) changed how it handles
import.meta.urlproperties - they are now determined at runtime instead of being statically analyzed at compile time. This broke playground-elements which uses dynamic imports withimport.meta.urlto load resources from unpkg.com:Solution
Since we already have playground-elements static resources copied to
website/static/, we can setsandboxBaseUrlto use the current origin for all environments (not just development). This way playground-elements never tries to resolve URLs from unpkg.com.Benefits