feat(html): add output.html.scriptLoading option#21200
Open
aryanraj45 wants to merge 1 commit into
Open
Conversation
|
1124d79 to
0da2f7f
Compare
0da2f7f to
063f0b9
Compare
Contributor
Author
|
@alexander-akait Added scriptLoading is in auto/defer/blocking, default auto, warns on defer/blocking+output.module. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Adds
output.html.scriptLoading(auto|defer|blocking) to control how the<script>tags injected into a generatedoutput.htmlpage load. Default isauto: a deferred classic script, or atype="module"script whenoutput.moduleis enabled (already deferred per spec).deferforces a deferred script,blockingemits a plain blocking script. Since ES module scripts are always deferred,defer/blockinghave no effect underoutput.moduleand now emit a compilation warning. Part of theexperiments.htmlroadmap, building onoutput.html(#21215).What kind of change does this PR introduce?
feat
Did you add tests for your changes?
Yes —
test/configCases/html/output-html-script-loading/coversauto/defer/blocking, the empty-object fallback, ES module output, and theoutput.moduleconflict warning (warnings.js).Does this PR introduce a breaking change?
No.
output.htmldefaults tofalse, andscriptLoadingdefaults toauto, which preserves the prior injected-script behavior.If relevant, what needs to be documented once your changes are merged or what have you already documented?
The
output.html.scriptLoadingoption should be added to the configuration docs once merged.Use of AI