-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Labels
Description
What version of Bun is running?
1.3.3+274e01c73
What platform is your computer?
Linux 6.17.11-300.fc43.x86_64 x86_64 unknown
What steps can reproduce the bug?
- Create an HTML file referencing a local stylesheet inside
<noscript>. - Execute the following command:
user@bun:~$ bun build *.html --production --minify --target=browser --outdir ./output/- Turn off JavaScript and find out that Bun’s bundler ignores the stylesheet completely.
What is the expected behavior?
For example, with following files:
<!-- index.html -->
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<noscript><link rel="stylesheet" href="noscript.css" /></noscript>
</head>
<body>
<p>Hello, World!</p>
</body>
</html>/* noscript.css */
p {
color: red;
}One expects the production of a file that shows Hello, World! in red when JavaScript is off.
What do you see instead?
Black text with error:
... GET file:///.../output/noscript.css net::ERR_FILE_NOT_FOUND<!-- ./output/index.html -->
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<noscript><link rel="stylesheet" href="noscript.css" /></noscript>
<script type="module" crossorigin src="./index-y1e0g89h.js"></script></head>
<body>
<p>Hello, World!</p>
</body>
</html>Additional information
<noscript> represents nothing if scripting is enabled. It is a crucial accessibility feature.
coderabbitai