Add `module.generator.html.extract` for HTML modules and the matching `output.htmlFilename` / `output.htmlChunkFilename` filename templates (defaults derived from `output.filename` / `output.chunkFilename` with `.js` swapped for `.html`, mirroring the CSS pipeline). When extraction is on, the parsed and URL-rewritten HTML is emitted as a standalone `.html` output file alongside the module's JavaScript export.
Comment thread
When `extract` is left unset, it defaults to `true` for HTML modules used as compilation entries (HTML entry points) and to `false` for HTML modules imported from JavaScript — so `entry: "./page.html"` just works.
Also fix `<script src>` / `<link rel="modulepreload">` references inside HTML modules to load every chunk in the referenced entry — including runtime chunks split off by `optimization.runtimeChunk` and shared chunks created by `optimization.splitChunks` — instead of only the entry chunk.
@@ -590,6 +590,14 @@ export type HotUpdateGlobal = string;
* The filename of the Hot Update Main File. It is inside the 'output.path' directory.
*/
export type HotUpdateMainFilename = string;
/**
* Specifies the filename template of non-initial output html files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
*/
export type HtmlChunkFilename = FilenameTemplate;
/**
* Specifies the filename template of output html files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
*/
export type HtmlFilename = FilenameTemplate;
/**
* Wrap javascript code into IIFE's to avoid leaking into global scope.
*/
Expand DownExpand Up
@@ -2431,6 +2439,14 @@ export interface Output {
* The filename of the Hot Update Main File. It is inside the 'output.path' directory.
*/
hotUpdateMainFilename?: HotUpdateMainFilename;
/**
* Specifies the filename template of non-initial output html files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
*/
htmlChunkFilename?: HtmlChunkFilename;
/**
* Specifies the filename template of output html files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
* Emit the parsed and URL-rewritten HTML as a standalone `.html` output file alongside the module's JavaScript export. When unset, extraction defaults to `true` for HTML modules used as compilation entries (HTML entry points) and `false` for HTML modules imported from JavaScript. Filenames follow `output.htmlFilename` / `output.htmlChunkFilename`.
* The filename of the Hot Update Main File. It is inside the 'output.path' directory.
*/
hotUpdateMainFilename?: HotUpdateMainFilename;
/**
* Specifies the filename template of non-initial output html files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
*/
htmlChunkFilename?: HtmlChunkFilename;
/**
* Specifies the filename template of output html files on disk. You must **not** specify an absolute path here, but the path may contain folders separated by '/'! The specified path is joined with the value of the 'output.path' option to determine the location on disk.
There was an error while loading. Please reload this page.
Loading
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.