Conversation
mbostock
reviewed
Feb 14, 2024
Member
mbostock
left a comment
There was a problem hiding this comment.
Hmm, I do think we’ll want to figure out how to treat these as assets that get included in the build (and added to _file or _import and content-hashed so it can be immutably cached). We should be able to mark these as external and then add them to the build, rewrite the relative paths, somehow?
(hashes provided for free by esbuild)
this is in order to remove the misleading messages from esbuild, because the developer cannot mark these assets as external.
Contributor
Author
|
related #423 |
mbostock
requested changes
Apr 25, 2024
Member
mbostock
left a comment
There was a problem hiding this comment.
We should change this so that importing in CSS produces the same result as linking to a static asset in HTML (i.e., it goes in _file).
Fil
added a commit
that referenced
this pull request
May 20, 2024
(This includes images and fonts using url().) Using onResolve (as suggested in #786 (comment)) closes #786 supersedes #788
2 tasks
Contributor
Author
|
superseded by #1372 😓 |
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.
closes #786
here's an example application (which I wouldn't necessarily recommend!) with a background image from docs/assets/ and fonts saved in docs/fonts/:
You can also use static assets to modify the toggle or caret with the docs/toggle.svg file :
The resources are inlined in text (for svg) base64 (for binary images and fonts), so use with some caution. Note that inlining fonts avoids FOUC, and the style.css is cached, so it's not necessarily bad. Just put these definitions at the bottom of stylesheet? The alternative is to use absolute URLs to an assets server.I'm working on saving these as assets.