Skip to content

Commit 948c004

Browse files
docs: hold the added comments to the two-line limit
tooling/check-comment-length.js flagged four comments the change grew past two lines, in the plugin and in both new test configs. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NuWDbcF2jvq7q1r8aEY5V9
1 parent ffc221c commit 948c004

3 files changed

Lines changed: 8 additions & 16 deletions

File tree

‎lib/html/HtmlModulesPlugin.js‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -733,12 +733,8 @@ class HtmlModulesPlugin {
733733
// a content-hashed filename makes a substring hit a real reference.
734734
/** @type {Set<string>} */
735735
const deletionCandidates = new Set(inlinedFiles);
736-
// A page-only entry's chunk rebuilds markup that was already
737-
// written out as the `.html` asset; the page loads the
738-
// `<script src>` entries the parser split out of it, never this
739-
// chunk. That covers the `data:text/html` wrapper entry
740-
// `output.html` adds, and an `.html` file used as an entry, whose
741-
// JS side is just the page as a string export.
736+
// A page-only entry's chunk only rebuilds markup already written
737+
// out as the `.html` asset, which no emitted page loads.
742738
for (const entrypoint of compilation.entrypoints.values()) {
743739
const chunk = entrypoint.getEntrypointChunk();
744740
if (!chunk) continue;
@@ -748,9 +744,8 @@ class HtmlModulesPlugin {
748744
chunk
749745
)) {
750746
const { resource } = /** @type {NormalModule} */ (entryModule);
751-
// A data URL counts only as the wrapper `output.html`
752-
// writes — another `text/html`-ish media type is an entry
753-
// the user asked for, and keeps its chunk.
747+
// Only the wrapper `output.html` writes counts; another
748+
// `text/html`-ish media type is the user's own entry.
754749
const dataUrl =
755750
typeof resource === "string" && resource.startsWith("data:");
756751
const wrapper = dataUrl && HTML_DATA_URL_RE.test(resource);

‎test/configCases/html/html-entry-library-js-asset/webpack.config.js‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
"use strict";
22

3-
// An `.html` entry whose JS side is asked for by name through `output.library`.
4-
// The page is still emitted, and the entry's JS asset is kept: the library is
5-
// what the user configured the build to hand back.
3+
// An `.html` entry whose JS side is asked for through `output.library`: the
4+
// page is still emitted, and the entry's JS asset is kept as the library.
65

76
const fs = require("fs");
87
const path = require("path");

‎test/configCases/html/html-entry-no-js-asset/webpack.config.js‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
"use strict";
22

3-
// An `.html` file used as a compilation entry. The entry chunk's JS side only
4-
// re-exports the markup that was written out as `page.html`, and the page loads
5-
// the `<script src>` entries the parser split out of it — never that chunk — so
6-
// no JS asset should be emitted for the entry.
3+
// An `.html` file used as a compilation entry: its chunk's JS side only
4+
// re-exports `page.html`, so no JS asset should be emitted for the entry.
75

86
const fs = require("fs");
97
const path = require("path");

0 commit comments

Comments
 (0)