You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport" content="width=device-width, initial-scale=1.0"><metaname="description" content="A simple HTML page with meta tags"><metaname="author" content="Your Name"><metaname="keywords" content="HTML, meta tags, simple page"><title>Simple HTML Page</title></head><body><h1>Welcome to My Simple Page</h1><p>This is a basic HTML page with essential meta tags.</p></body></html>
Run this command (which works):
bun build index.html --outdir dist
The HTML output should be:
HTML code
<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport" content="width=device-width, initial-scale=1.0"><metaname="description" content="A simple HTML page with meta tags"><metaname="author" content="Your Name"><metaname="keywords" content="HTML, meta tags, simple page"><title>Simple HTML Page</title><scripttype="module" crossoriginsrc="./index-[hash].js"></script></head><body><h1>Welcome to My Simple Page</h1><p>This is a basic HTML page with essential meta tags.</p></body></html>
Now run this command instead, which does not work:
bun build index.html --outdir dist --minify
The HTML file will now look like:
<!DOCTYPE html><htmllang="en"><head><scripttype="module" crossoriginsrc="./index-[hash].js"></script></head><body><h1>Welcome to My Simple Page</h1><p>This is a basic HTML page with essential meta tags.</p></body></html>
Notice that the <meta> tags and <title> are missing.
I have a suspicion that when minifying, Bun just includes the scripts and CSS in the head, erasing everything else.
What is the expected behavior?
The minified HTML output should include other tags in <head>, like this:
HTML code
<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><metaname="viewport" content="width=device-width, initial-scale=1.0"><metaname="description" content="A simple HTML page with meta tags"><metaname="author" content="Your Name"><metaname="keywords" content="HTML, meta tags, simple page"><title>Simple HTML Page</title><scripttype="module" crossoriginsrc="./index-y1e0g89h.js"></script></head><body><h1>Welcome to My Simple Page</h1><p>This is a basic HTML page with essential meta tags.</p></body></html>
What do you see instead?
Missing tags in <head>.
Additional information
No response
The text was updated successfully, but these errors were encountered:
What version of Bun is running?
1.2.2
What platform is your computer?
Linux 6.11.0-14-generic x86_64 x86_64
What steps can reproduce the bug?
Start with an HTML file like this one:
Run this command (which works):
The HTML output should be:
HTML code
Now run this command instead, which does not work:
The HTML file will now look like:
Notice that the
<meta>
tags and<title>
are missing.I have a suspicion that when minifying, Bun just includes the scripts and CSS in the head, erasing everything else.
What is the expected behavior?
The minified HTML output should include other tags in
<head>
, like this:HTML code
What do you see instead?
Missing tags in
<head>
.Additional information
No response
The text was updated successfully, but these errors were encountered: