Skip to content
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

Bun build --experimental-html removes script element in body #16442

Open
qinyuhang opened this issue Jan 16, 2025 · 0 comments
Open

Bun build --experimental-html removes script element in body #16442

qinyuhang opened this issue Jan 16, 2025 · 0 comments
Labels
bug Something isn't working bundler Something to do with the bundler

Comments

@qinyuhang
Copy link

What version of Bun is running?

1.1.43

What platform is your computer?

Darwin 24.2.0 x86_64 i386

What steps can reproduce the bug?

When using bun build —experimental-html ./index.html, the script element in body would be removed, but in head would not. Behavior different than vite or webpack.

Here is the repo to reproduce https://github.com/qinyuhang/bun-build-error

  1. See the directory html_dist_not_contain_script.
  2. Run bun install && bun run build

What is the expected behavior?

The <script /> element in body should be preserved just like vite or webpack do.

What do you see instead?

The <script /> element in body was removed in the dist output

Additional information

Script elements in head was preserved

@qinyuhang qinyuhang added bug Something isn't working needs triage labels Jan 16, 2025
@RiskyMH RiskyMH added bundler Something to do with the bundler and removed needs triage labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bundler Something to do with the bundler
Projects
None yet
Development

No branches or pull requests

2 participants