-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Support bundling HTML files and their js, css, and assets in Bun.build
and bun build
#15940
Conversation
Updated 10:09 AM PT - Dec 23rd, 2024
✅ @Jarred-Sumner, your commit 806c4b2 has passed in 🧪 try this PR locally: bunx bun-pr 15940 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall legendary pr. very nice to have this.
random nitpicks and two that should be considered before merging. the main logic looks fine
// a <link rel="modulepreload" href="..." crossorigin> tag that | ||
// points to the module or chunk's unique key so that we tell the | ||
// browser to preload the user's code. | ||
// We might also want to force <!DOCTYPE html> at the top of the file, but I'm not sure about that yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its fine to take no action re:doctype
the one person who wants to bundle quirks mode html can do so
awesome !!! but would you fix #5241 ? this block we switch to bun build |
What does this PR do?
Fixes #4688
This lets you bundle HTML files in Bun. It uses
lol-html
to parse and enqueue assets.Currently, elements matching the following selectors are considered for either bundling (if js/css) or copied when non-external:
script[src]
link[rel='stylesheet'][href]
link[as='style'][href]
link[as='font'][href], link[type^='font/'][href]
link[as='image'][href]
link[as='video'][href], link[as='audio'][href]
link[as='worker'][href]
link[rel='manifest'][href]
link[rel='icon'][href], link[rel='apple-touch-icon'][href]
link:not([rel~='stylesheet']):not([rel~='modulepreload']):not([rel~='manifest']):not([rel~='icon']):not([rel~='apple-touch-icon'])[href]
img[src]
img[srcset]
video[src]
video[poster]
audio[src]
source[src]
source[srcset]
iframe[src]
This list will probably change before this merges. It should probably be configurable.
How did you verify your code works?
There are tests.