feat(html): builtins.html
should inject <script src="xxxx.js" />
in <head />
#2770
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.
Summary
Fixes #2768
🤖 Generated by Copilot at c645a9e
This pull request changes the default behavior of the
rspack_plugin_html
crate to inject script tags into the head element of the HTML output instead of the body element. This improves performance and avoids duplication of scripts in some cases. It also adds a feature to allow users to customize the filename of the output file using a content hash. It updates the test cases and expected outputs to match the new behavior and feature.Related issue (if exists)
Walkthrough
🤖 Generated by Copilot at c645a9e
default.cf6dd0ecc5222c7a.html
) (link)default.c58a17e264b8bc1.html
) (link)foo
in the template+templateParameters test case (link)bar
in the templateContent+templateParameters test case (link)title
option in the title test case (link)