You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7cff6da
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(types): use real types instead of unknown and Record<string, unknown>
Type the minimizer options, transform switches, profiler parameters, CLI configuration values, HMR handlers and the deprecated externals function precisely.
* @param {number | undefined} index index of value when multiple values are provided, otherwise undefined
524
-
* @returns {{ problem?: LocalProblem, object?: ObjectConfiguration, property?: Property, value?: unknown }} problem or object with property and value
526
+
* @returns {{ problem?: LocalProblem, object?: ObjectConfiguration, property?: Property, value?: ConfigurationValue }} problem or object with property and value
Copy file name to clipboardExpand all lines: lib/html/htmlMinify.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -5,8 +5,8 @@
5
5
6
6
"use strict";
7
7
8
-
/** @import { HtmlPrintOptions } from "../html/syntax-printer" */
9
-
/** @import { CssEnvironment } from "../css/syntax-parser" */
8
+
/** @import { HtmlPrintOptions, HtmlTransformOptions} from "../html/syntax-printer" */
9
+
/** @import { CssEnvironment, CssTransformOptions} from "../css/syntax-parser" */
10
10
11
11
/**
12
12
* What a renderer made of one embedded body: the minified text, and anything it
@@ -37,7 +37,7 @@
37
37
* re-resolves in the worker — via the installed package, or the dev self-link.
38
38
* @param {{ [file: string]: string | Buffer }} input a single `{ filename: code }` entry; a `Buffer` is read as UTF-8
39
39
* @param {(RawSourceMap | undefined)=} sourceMap input source map (unused: safe serialize keeps positions token-coarse, so no map is produced yet)
40
-
* @param {Omit<HtmlPrintOptions, "renderEmbeddedSource" | "deferEmbeddedSource"> & { environment?: CssEnvironment, css?: { convertLengthUnits?: boolean, convertApproximateColors?: boolean, dropOverriddenDeclarations?: boolean, rewriteCustomProperties?: boolean, unusedSymbols?: string[], pseudoClasses?: { [name: string]: string } }, minifyConditionalComments?: boolean, extractComments?: MinimizeExtractComments, renderEmbeddedSource?: AsyncEmbeddedSourceRenderer }=} minimizerOptions minimizer options — `environment` and `css` (`optimization.minimize.css`, whole) reach the CSS minifier this runs over inline CSS; the rest is `optimization.minimize.html`. The two stand apart rather than merged: both languages name a `quotes` and a `comments`, and one flat object would hand each the other's answer. `renderEmbeddedSource` minifies source this document embeds and may be asynchronous — one parse serves both it and the output. What it declines this minifies itself, for the languages webpack ships a minifier for
40
+
* @param {Omit<HtmlPrintOptions, "renderEmbeddedSource" | "deferEmbeddedSource"> & { environment?: CssEnvironment, css?: { convertLengthUnits?: boolean, convertApproximateColors?: boolean, dropOverriddenDeclarations?: boolean, rewriteCustomProperties?: boolean, unusedSymbols?: string[], pseudoClasses?: { [name: string]: string } } & CssTransformOptions, minifyConditionalComments?: boolean, extractComments?: MinimizeExtractComments, renderEmbeddedSource?: AsyncEmbeddedSourceRenderer } & HtmlTransformOptions=} minimizerOptions minimizer options — `environment` and `css` (`optimization.minimize.css`, whole) reach the CSS minifier this runs over inline CSS; the rest is `optimization.minimize.html`. The two stand apart rather than merged: both languages name a `quotes` and a `comments`, and one flat object would hand each the other's answer. `renderEmbeddedSource` minifies source this document embeds and may be asynchronous — one parse serves both it and the output. What it declines this minifies itself, for the languages webpack ships a minifier for
41
41
* @param {ExtractCommentsOption=} extractComments the plugin's `extractComments`, read where `minimize.html.extractComments` is not set
42
42
* @returns {Promise<{ code: string, extractedComments?: string[], warnings?: (Error | string)[], errors?: (Error | string)[] }>} the minified HTML, the comments taken out of it, and what a renderer reported over what it embeds
* @param {string | null} filename what its tokens name as their file
14511
14511
* @param {number} base the number of this parse's first token
14512
-
* @returns {{ onComment: import("./syntax-parser").OnComment, onToken: (parser: EXPECTED_ANY) => void, shebang: (text: string) => void, finish: () => void, at: (pos: number, ending: boolean, forward?: number) => number | undefined, table: TokenTable }} where to report comments and tokens, the token at an offset, what narrows the tables once the parse is over, and the table its numbers are read through
14512
+
* @returns {{ onComment: import("./syntax-parser").OnComment, onToken: NonNullable<import("./syntax-parser").Options["onTokenRead"]>, shebang: (text: string) => void, finish: () => void, at: (pos: number, ending: boolean, forward?: number) => number | undefined, table: TokenTable }} where to report comments and tokens, the token at an offset, what narrows the tables once the parse is over, and the table its numbers are read through
0 commit comments