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 7606cb0
Browse filesBrowse the repository at this point in the historyBrowse files
Carries what a minimizer may do beyond the transforms that always apply,
starting with html.collapseWhitespace: each run of whitespace in text
becomes a single space, never nothing — removing it joins two inline
elements that render apart. Skipped under pre/textarea/listing and for
text holding a '<', which stays on the source-passthrough path.
Accept an object for `optimization.minimize`, carrying what a minimizer may do beyond the always-safe transforms — starting with `html.collapseWhitespace`.
* Enable minimizing the output. Uses optimization.minimizer.
2273
+
* Enable minimizing the output. Uses optimization.minimizer. An object enables it and configures what a minimizer may do beyond the transforms that always apply.
2274
2274
*/
2275
-
minimize?: boolean;
2275
+
minimize?:
2276
+
|boolean
2277
+
|{
2278
+
/**
2279
+
* What the HTML minimizer may do beyond the transforms that always apply.
* What the HTML minimizer may do beyond the transforms that always apply.
2349
+
* @since 5.110.0
2350
+
*/
2351
+
exportinterfaceOptimizationMinimizeHtml{
2352
+
/**
2353
+
* Collapse each run of whitespace in text to a single space. Left alone inside `pre`, `textarea` and `listing`, where whitespace is significant, and never removed entirely — dropping it would join two inline elements that render apart.
* Enable minimizing the output. Uses optimization.minimizer.
4445
+
* Enable minimizing the output. Uses optimization.minimizer. An object enables it and configures what a minimizer may do beyond the transforms that always apply.
4428
4446
*/
4429
-
minimize?: boolean;
4447
+
minimize?:
4448
+
|boolean
4449
+
|{
4450
+
/**
4451
+
* What the HTML minimizer may do beyond the transforms that always apply.
* @property {HtmlAstSkip=} skip node kinds to omit from the AST for speed/memory (see `HtmlAstSkip`)
7854
7884
* @property {boolean=} minimize print the safely-minified serialization (nodes rebuilt from source, inert comments dropped, opening-tag whitespace collapsed) as `process` walks, and return it (default false = walk only, return `""`)
7855
7885
* @property {CssEnvironment=} environment what the target can read, forwarded to the CSS minifier this runs over an inline `<style>` and every `style=""`
7886
+
* @property {boolean=} collapseWhitespace collapse each run of whitespace in text to a single space, except where an ancestor renders it verbatim (default false)
Copy file name to clipboardExpand all lines: schemas/WebpackOptions.json
+43-4Lines changed: 43 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -3569,8 +3569,21 @@
3569
3569
"type": "boolean"
3570
3570
},
3571
3571
"minimize": {
3572
-
"description": "Enable minimizing the output. Uses optimization.minimizer.",
3573
-
"type": "boolean"
3572
+
"description": "Enable minimizing the output. Uses optimization.minimizer. An object enables it and configures what a minimizer may do beyond the transforms that always apply.",
3573
+
"anyOf": [
3574
+
{
3575
+
"type": "boolean"
3576
+
},
3577
+
{
3578
+
"type": "object",
3579
+
"additionalProperties": false,
3580
+
"properties": {
3581
+
"html": {
3582
+
"$ref": "#/definitions/OptimizationMinimizeHtml"
3583
+
}
3584
+
}
3585
+
}
3586
+
]
3574
3587
},
3575
3588
"minimizer": {
3576
3589
"description": "Minimizer(s) to use for minimizing the output.",
@@ -3677,6 +3690,19 @@
3677
3690
}
3678
3691
}
3679
3692
},
3693
+
"OptimizationMinimizeHtml": {
3694
+
"description": "What the HTML minimizer may do beyond the transforms that always apply.",
3695
+
"type": "object",
3696
+
"additionalProperties": false,
3697
+
"properties": {
3698
+
"collapseWhitespace": {
3699
+
"description": "Collapse each run of whitespace in text to a single space. Left alone inside `pre`, `textarea` and `listing`, where whitespace is significant, and never removed entirely — dropping it would join two inline elements that render apart.",
"description": "Enable minimizing the output. Uses optimization.minimizer.",
3752
-
"type": "boolean"
3777
+
"description": "Enable minimizing the output. Uses optimization.minimizer. An object enables it and configures what a minimizer may do beyond the transforms that always apply.",
3778
+
"anyOf": [
3779
+
{
3780
+
"type": "boolean"
3781
+
},
3782
+
{
3783
+
"type": "object",
3784
+
"additionalProperties": false,
3785
+
"properties": {
3786
+
"html": {
3787
+
"$ref": "#/definitions/OptimizationMinimizeHtml"
3788
+
}
3789
+
}
3790
+
}
3791
+
]
3753
3792
},
3754
3793
"minimizer": {
3755
3794
"description": "Minimizer(s) to use for minimizing the output.",
Copy file name to clipboardExpand all lines: test/__snapshots__/Cli.basictest.js.snap
+15-2Lines changed: 15 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -9920,13 +9920,26 @@ Object {
9920
9920
"optimization-minimize": Object {
9921
9921
"configs": Array [
9922
9922
Object {
9923
-
"description": "Enable minimizing the output. Uses optimization.minimizer.",
9923
+
"description": "Enable minimizing the output. Uses optimization.minimizer. An object enables it and configures what a minimizer may do beyond the transforms that always apply.",
9924
9924
"multiple": false,
9925
9925
"path": "optimization.minimize",
9926
9926
"type": "boolean",
9927
9927
},
9928
9928
],
9929
-
"description": "Enable minimizing the output. Uses optimization.minimizer.",
9929
+
"description": "Enable minimizing the output. Uses optimization.minimizer. An object enables it and configures what a minimizer may do beyond the transforms that always apply.",
"description": "Collapse each run of whitespace in text to a single space. Left alone inside \`pre\`, \`textarea\` and \`listing\`, where whitespace is significant, and never removed entirely — dropping it would join two inline elements that render apart.",
"description": "Collapse each run of whitespace in text to a single space. Left alone inside \`pre\`, \`textarea\` and \`listing\`, where whitespace is significant, and never removed entirely — dropping it would join two inline elements that render apart.",
0 commit comments