-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathhtml-minifier-next.schema.json
More file actions
307 lines (307 loc) · 9.75 KB
/
Copy pathhtml-minifier-next.schema.json
File metadata and controls
307 lines (307 loc) · 9.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/j9t/html-minifier-next/main/html-minifier-next.schema.json",
"title": "HTML Minifier Next configuration",
"description": "Configuration file for HTML Minifier Next (HMN), used via `--config-file`",
"type": "object",
"properties": {
"$schema": {
"description": "JSON Schema reference for this configuration file (enables editor validation and autocomplete)",
"type": "string"
},
"preset": {
"description": "Preset configuration to start from—config file options override preset options",
"enum": [
"conservative",
"comprehensive"
]
},
"fileExt": {
"description": "File extension(s) to process, as comma-separated string or array (default: `html,htm,shtml,shtm`; use `*` for all files)",
"type": [
"string",
"array"
],
"items": {
"type": "string"
}
},
"ignoreDir": {
"description": "Directories—relative to the input directory—to exclude from processing, as comma-separated string or array",
"type": [
"string",
"array"
],
"items": {
"type": "string"
}
},
"cacheCSS": {
"description": "Set CSS minification cache size (number of entries, default: 500)",
"type": "integer",
"minimum": 0
},
"cacheJS": {
"description": "Set JavaScript minification cache size (number of entries, default: 500)",
"type": "integer",
"minimum": 0
},
"cacheSVG": {
"description": "Set SVG minification cache size (number of entries, default: 500)",
"type": "integer",
"minimum": 0
},
"caseSensitive": {
"description": "Treat attributes in case-sensitive manner (useful for custom HTML elements)",
"type": "boolean"
},
"collapseAttributeWhitespace": {
"description": "Trim and collapse whitespace characters within attribute values",
"type": "boolean"
},
"collapseBooleanAttributes": {
"description": "Omit attribute values from boolean attributes",
"type": "boolean"
},
"collapseInlineTagWhitespace": {
"description": "Collapse whitespace more aggressively between inline elements—use with `--collapse-whitespace`",
"type": "boolean"
},
"collapseWhitespace": {
"description": "Collapse whitespace that contributes to text nodes in a document tree",
"type": "boolean"
},
"conservativeCollapse": {
"description": "Always collapse to one space (never remove it entirely)—use with `--collapse-whitespace`",
"type": "boolean"
},
"continueOnMinifyError": {
"description": "Continue on minification errors",
"type": "boolean"
},
"continueOnParseError": {
"description": "Handle parse errors instead of aborting",
"type": "boolean"
},
"customAttrAssign": {
"description": "Array of regexes that allow to support custom attribute assign expressions (e.g., `<div flex?=\"{{mode != cover}}\"></div>`)",
"type": [
"string",
"array"
],
"items": {
"type": "string"
}
},
"customAttrCollapse": {
"description": "Regex that specifies custom attribute to strip newlines from (e.g., `/ng-class/`)",
"type": "string"
},
"customAttrSurround": {
"description": "Array of regexes that allow to support custom attribute surround expressions (e.g., `<input {{#if value}}checked=\"checked\"{{/if}}>`)",
"type": [
"string",
"array"
],
"items": {
"type": "string"
}
},
"customEventAttributes": {
"description": "Array of regexes that allow to support custom event attributes for minifyJS (e.g., `ng-click`)",
"type": [
"string",
"array"
],
"items": {
"type": "string"
}
},
"customFragmentQuantifierLimit": {
"description": "Set maximum quantifier limit for custom fragments to prevent ReDoS attacks (default: 200)",
"type": "integer",
"minimum": 0
},
"decodeEntities": {
"description": "Use direct Unicode characters whenever possible",
"type": "boolean"
},
"ignoreCustomComments": {
"description": "Array of regexes that allow to ignore matching comments",
"type": [
"string",
"array"
],
"items": {
"type": "string"
}
},
"ignoreCustomFragments": {
"description": "Array of regexes that allow to ignore certain fragments, when matched (e.g., `<?php … ?>`, `{{ … }}`)",
"type": [
"string",
"array"
],
"items": {
"type": "string"
}
},
"includeAutoGeneratedTags": {
"description": "Insert elements generated by HTML parser",
"type": "boolean"
},
"inlineCustomElements": {
"description": "Array of names of custom elements which are inline, for whitespace handling",
"type": [
"string",
"array"
],
"items": {
"type": "string"
}
},
"keepClosingSlash": {
"description": "Keep the trailing slash on void elements",
"type": "boolean"
},
"maxInputLength": {
"description": "Maximum input length to prevent ReDoS attacks",
"type": "integer",
"minimum": 0
},
"maxLineLength": {
"description": "Specify a maximum line length; compressed output will be split by newlines at valid HTML split-points",
"type": "integer",
"minimum": 0
},
"mergeScripts": {
"description": "Merge consecutive inline `script` elements into one",
"type": "boolean"
},
"minifyCSS": {
"description": "Minify CSS in `style` elements and attributes (uses Lightning CSS)",
"type": [
"boolean",
"object"
]
},
"minifyJS": {
"description": "Minify JavaScript in `script` elements and event attributes (uses Terser or SWC; pass `{\"engine\": \"swc\"}` for SWC)",
"type": [
"boolean",
"object"
]
},
"minifySVG": {
"description": "Minify SVG elements (uses SVGO)",
"type": [
"boolean",
"object"
]
},
"minifyURLs": {
"description": "Minify URLs in various attributes",
"type": [
"boolean",
"string",
"object"
]
},
"noNewlinesBeforeTagClose": {
"description": "Never add a newline before a tag that closes an element",
"type": "boolean"
},
"partialMarkup": {
"description": "Treat input as a partial HTML fragment, preserving stray end tags and unclosed tags",
"type": "boolean"
},
"preserveLineBreaks": {
"description": "Always collapse to one line break (never remove it entirely) when whitespace between tags includes a line break—use with `--collapse-whitespace`",
"type": "boolean"
},
"preventAttributesEscaping": {
"description": "Prevents the escaping of the values of attributes",
"type": "boolean"
},
"processScripts": {
"description": "Array of strings corresponding to types of `script` elements to process through minifier (e.g., `text/ng-template`, `text/x-handlebars-template`, etc.)",
"type": [
"string",
"array"
],
"items": {
"type": "string"
}
},
"quoteCharacter": {
"description": "Type of quote to use for attribute values (`'` or `\"`)",
"type": "string"
},
"removeAttributeQuotes": {
"description": "Remove quotes around attributes when possible",
"type": "boolean"
},
"removeComments": {
"description": "Strip HTML comments",
"type": "boolean"
},
"removeDefaultTypeAttributes": {
"description": "Remove default `type` attributes from `style`/`link` (e.g., `type=\"text/css\"`) and `script` (e.g., `type=\"text/javascript\"`) elements; other `type` attribute values are left intact",
"type": "boolean"
},
"removeEmptyAttributes": {
"description": "Remove all attributes with whitespace-only values",
"type": "boolean"
},
"removeEmptyElements": {
"description": "Remove all elements with empty contents",
"type": "boolean"
},
"removeEmptyElementsExcept": {
"description": "Array of elements to preserve when `--remove-empty-elements` is enabled (e.g., `td`, `<span aria-hidden=\"true\">`)",
"type": [
"string",
"array"
],
"items": {
"type": "string"
}
},
"removeOptionalTags": {
"description": "Remove optional tags",
"type": "boolean"
},
"removeRedundantAttributes": {
"description": "Remove attributes when value matches default",
"type": "boolean"
},
"removeTagWhitespace": {
"description": "Remove space between attributes whenever possible; note that this will result in invalid HTML",
"type": "boolean"
},
"removeUnusedCSS": {
"description": "Remove rules from `style` elements whose class or ID selectors the document never references (requires `--minify-css`); note that class names only applied by external scripts cannot be detected—use `{\"safelist\": […]}` for those",
"type": [
"boolean",
"object"
]
},
"sortAttributes": {
"description": "Sort attributes by frequency",
"type": "boolean"
},
"sortClassNames": {
"description": "Sort style classes by frequency",
"type": "boolean"
},
"trimCustomFragments": {
"description": "Trim whitespace around custom fragments (`--ignore-custom-fragments`)",
"type": "boolean"
},
"useShortDoctype": {
"description": "Replaces the doctype with the short HTML doctype",
"type": "boolean"
}
},
"additionalProperties": false
}