html-minifier 4.0.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +23 -0
- package/README.md +851 -110
- package/cli.js +991 -207
- package/dist/types/htmlminifier.d.ts +629 -0
- package/dist/types/htmlminifier.d.ts.map +1 -0
- package/dist/types/htmlparser.d.ts +28 -0
- package/dist/types/htmlparser.d.ts.map +1 -0
- package/dist/types/lib/attributes.d.ts +87 -0
- package/dist/types/lib/attributes.d.ts.map +1 -0
- package/dist/types/lib/constants.d.ts +421 -0
- package/dist/types/lib/constants.d.ts.map +1 -0
- package/dist/types/lib/content.d.ts +44 -0
- package/dist/types/lib/content.d.ts.map +1 -0
- package/dist/types/lib/elements.d.ts +48 -0
- package/dist/types/lib/elements.d.ts.map +1 -0
- package/dist/types/lib/fragments.d.ts +47 -0
- package/dist/types/lib/fragments.d.ts.map +1 -0
- package/dist/types/lib/option-definitions.d.ts +33 -0
- package/dist/types/lib/option-definitions.d.ts.map +1 -0
- package/dist/types/lib/options.d.ts +93 -0
- package/dist/types/lib/options.d.ts.map +1 -0
- package/dist/types/lib/unused-css.d.ts +76 -0
- package/dist/types/lib/unused-css.d.ts.map +1 -0
- package/dist/types/lib/urls.d.ts +15 -0
- package/dist/types/lib/urls.d.ts.map +1 -0
- package/dist/types/lib/utils.d.ts +132 -0
- package/dist/types/lib/utils.d.ts.map +1 -0
- package/dist/types/lib/whitespace.d.ts +97 -0
- package/dist/types/lib/whitespace.d.ts.map +1 -0
- package/dist/types/presets.d.ts +50 -0
- package/dist/types/presets.d.ts.map +1 -0
- package/dist/types/tokenchain.d.ts +36 -0
- package/dist/types/tokenchain.d.ts.map +1 -0
- package/html-minifier.schema.json +322 -0
- package/package.json +70 -58
- package/src/htmlminifier.js +2845 -1107
- package/src/htmlparser.js +1163 -452
- package/src/lib/attributes.js +1196 -0
- package/src/lib/constants.js +521 -0
- package/src/lib/content.js +237 -0
- package/src/lib/elements.js +268 -0
- package/src/lib/file-pool.js +193 -0
- package/src/lib/file-write.js +87 -0
- package/src/lib/fragments.js +340 -0
- package/src/lib/option-definitions.js +246 -0
- package/src/lib/options.js +841 -0
- package/src/lib/unused-css.js +499 -0
- package/src/lib/urls.js +146 -0
- package/src/lib/utils.js +1026 -0
- package/src/lib/whitespace.js +431 -0
- package/src/presets.js +58 -0
- package/src/tokenchain.js +142 -56
- package/LICENSE +0 -22
- package/sample-cli-config-file.conf +0 -40
- package/src/utils.js +0 -18
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/j9t/html-minifier/main/html-minifier.schema.json",
|
|
4
|
+
"title": "HTML Minifier configuration",
|
|
5
|
+
"description": "Configuration file for HTML Minifier (HM), used via `--config-file`",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"$schema": {
|
|
9
|
+
"description": "JSON Schema reference for this configuration file (enables editor validation and autocomplete)",
|
|
10
|
+
"type": "string"
|
|
11
|
+
},
|
|
12
|
+
"preset": {
|
|
13
|
+
"description": "Preset configuration to start from—config file options override preset options",
|
|
14
|
+
"enum": [
|
|
15
|
+
"conservative",
|
|
16
|
+
"comprehensive"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
"fileExt": {
|
|
20
|
+
"description": "File extension(s) to process, as comma-separated string or array (default: `html,htm,shtml,shtm`; use `*` for all files)",
|
|
21
|
+
"type": [
|
|
22
|
+
"string",
|
|
23
|
+
"array"
|
|
24
|
+
],
|
|
25
|
+
"items": {
|
|
26
|
+
"type": "string"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"ignoreDir": {
|
|
30
|
+
"description": "Directories—relative to the input directory—to exclude from processing, as comma-separated string or array",
|
|
31
|
+
"type": [
|
|
32
|
+
"string",
|
|
33
|
+
"array"
|
|
34
|
+
],
|
|
35
|
+
"items": {
|
|
36
|
+
"type": "string"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"cacheCSS": {
|
|
40
|
+
"description": "Set CSS minification cache size (number of entries, default: 500)",
|
|
41
|
+
"type": "integer",
|
|
42
|
+
"minimum": 0
|
|
43
|
+
},
|
|
44
|
+
"cacheJS": {
|
|
45
|
+
"description": "Set JavaScript minification cache size (number of entries, default: 500)",
|
|
46
|
+
"type": "integer",
|
|
47
|
+
"minimum": 0
|
|
48
|
+
},
|
|
49
|
+
"cacheSVG": {
|
|
50
|
+
"description": "Set SVG minification cache size (number of entries, default: 500)",
|
|
51
|
+
"type": "integer",
|
|
52
|
+
"minimum": 0
|
|
53
|
+
},
|
|
54
|
+
"caseSensitive": {
|
|
55
|
+
"description": "Keep element and attribute names as written (e.g., for framework components like `<MyButton>`)",
|
|
56
|
+
"type": "boolean"
|
|
57
|
+
},
|
|
58
|
+
"collapseAttributeWhitespace": {
|
|
59
|
+
"description": "Trim and collapse whitespace characters within attribute values",
|
|
60
|
+
"type": "boolean"
|
|
61
|
+
},
|
|
62
|
+
"collapseBooleanAttributes": {
|
|
63
|
+
"description": "Omit attribute values from boolean attributes",
|
|
64
|
+
"type": "boolean"
|
|
65
|
+
},
|
|
66
|
+
"collapseEmptyAttributes": {
|
|
67
|
+
"description": "Omit empty attribute values (e.g., `alt=\"\"` → `alt`)",
|
|
68
|
+
"type": "boolean"
|
|
69
|
+
},
|
|
70
|
+
"collapseInlineTagWhitespace": {
|
|
71
|
+
"description": "Collapse whitespace more aggressively between inline elements—use with `--collapse-whitespace`",
|
|
72
|
+
"type": "boolean"
|
|
73
|
+
},
|
|
74
|
+
"collapseNoBreakSpaces": {
|
|
75
|
+
"description": "Remove whitespace next to no-break spaces, narrow no-break spaces, and figure spaces in text (e.g., `a b` → `a b`), keeping runs of them—use with `--collapse-whitespace`",
|
|
76
|
+
"type": "boolean"
|
|
77
|
+
},
|
|
78
|
+
"collapseWhitespace": {
|
|
79
|
+
"description": "Collapse whitespace that contributes to text nodes in a document tree",
|
|
80
|
+
"type": "boolean"
|
|
81
|
+
},
|
|
82
|
+
"conservativeCollapse": {
|
|
83
|
+
"description": "Always collapse to one space (never remove it entirely)—use with `--collapse-whitespace`",
|
|
84
|
+
"type": "boolean"
|
|
85
|
+
},
|
|
86
|
+
"continueOnMinifyError": {
|
|
87
|
+
"description": "Continue on minification errors",
|
|
88
|
+
"type": "boolean"
|
|
89
|
+
},
|
|
90
|
+
"continueOnParseError": {
|
|
91
|
+
"description": "Handle parse errors instead of aborting",
|
|
92
|
+
"type": "boolean"
|
|
93
|
+
},
|
|
94
|
+
"customAttrAssign": {
|
|
95
|
+
"description": "Array of regexes that allow to support custom attribute assign expressions (e.g., `<div flex?=\"{{mode != cover}}\"></div>`)",
|
|
96
|
+
"type": [
|
|
97
|
+
"string",
|
|
98
|
+
"array"
|
|
99
|
+
],
|
|
100
|
+
"items": {
|
|
101
|
+
"type": "string"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"customAttrCollapse": {
|
|
105
|
+
"description": "Regex that specifies custom attribute to strip newlines from (e.g., `/ng-class/`)",
|
|
106
|
+
"type": "string"
|
|
107
|
+
},
|
|
108
|
+
"customAttrSurround": {
|
|
109
|
+
"description": "Array of regexes that allow to support custom attribute surround expressions (e.g., `<input {{#if value}}checked=\"checked\"{{/if}}>`)",
|
|
110
|
+
"type": [
|
|
111
|
+
"string",
|
|
112
|
+
"array"
|
|
113
|
+
],
|
|
114
|
+
"items": {
|
|
115
|
+
"type": "string"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"customEventAttributes": {
|
|
119
|
+
"description": "Array of regexes that allow to support custom event attributes (e.g., `ng-click`)—use with `--minify-js`",
|
|
120
|
+
"type": [
|
|
121
|
+
"string",
|
|
122
|
+
"array"
|
|
123
|
+
],
|
|
124
|
+
"items": {
|
|
125
|
+
"type": "string"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"decodeEntities": {
|
|
129
|
+
"description": "Use direct Unicode characters whenever possible",
|
|
130
|
+
"type": "boolean"
|
|
131
|
+
},
|
|
132
|
+
"ignoreCustomComments": {
|
|
133
|
+
"description": "Array of regexes that allow to ignore matching comments",
|
|
134
|
+
"type": [
|
|
135
|
+
"string",
|
|
136
|
+
"array"
|
|
137
|
+
],
|
|
138
|
+
"items": {
|
|
139
|
+
"type": "string"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"ignoreCustomFragments": {
|
|
143
|
+
"description": "Array of regexes that allow to ignore certain fragments, when matched (e.g., `<?php … ?>`, `{{ … }}`, etc.)",
|
|
144
|
+
"type": [
|
|
145
|
+
"string",
|
|
146
|
+
"array"
|
|
147
|
+
],
|
|
148
|
+
"items": {
|
|
149
|
+
"type": "string"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"includeAutoGeneratedTags": {
|
|
153
|
+
"description": "Insert elements generated by HTML parser",
|
|
154
|
+
"type": "boolean"
|
|
155
|
+
},
|
|
156
|
+
"inlineCustomElements": {
|
|
157
|
+
"description": "Array of names of custom elements which are inline, for whitespace handling—use with `--collapse-whitespace`",
|
|
158
|
+
"type": [
|
|
159
|
+
"string",
|
|
160
|
+
"array"
|
|
161
|
+
],
|
|
162
|
+
"items": {
|
|
163
|
+
"type": "string"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"keepClosingSlash": {
|
|
167
|
+
"description": "Keep the trailing slash on void elements and other start tags that carry one, and read it as closing the element",
|
|
168
|
+
"type": "boolean"
|
|
169
|
+
},
|
|
170
|
+
"maxInputLength": {
|
|
171
|
+
"description": "Maximum input length to prevent ReDoS attacks",
|
|
172
|
+
"type": "integer",
|
|
173
|
+
"minimum": 0
|
|
174
|
+
},
|
|
175
|
+
"maxLineLength": {
|
|
176
|
+
"description": "Specify a maximum line length; output will be split by newlines in tags only (between attributes or before a tag’s `>`), where they can’t change the page, so lines may run longer",
|
|
177
|
+
"type": "integer",
|
|
178
|
+
"minimum": 0
|
|
179
|
+
},
|
|
180
|
+
"mergeScripts": {
|
|
181
|
+
"description": "Merge consecutive inline `script` elements into one",
|
|
182
|
+
"type": "boolean"
|
|
183
|
+
},
|
|
184
|
+
"minifyCSS": {
|
|
185
|
+
"description": "Minify CSS in `style` elements and attributes (uses Lightning CSS)",
|
|
186
|
+
"type": [
|
|
187
|
+
"boolean",
|
|
188
|
+
"object"
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
"minifyJS": {
|
|
192
|
+
"description": "Minify JavaScript in `script` elements and event attributes (uses Terser or SWC; pass `{\"engine\": \"swc\"}` for SWC)",
|
|
193
|
+
"type": [
|
|
194
|
+
"boolean",
|
|
195
|
+
"object"
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
"minifyJSON": {
|
|
199
|
+
"description": "Minify JSON in `script` elements (e.g., `application/ld+json`, `importmap`, etc.) by removing whitespace",
|
|
200
|
+
"type": "boolean"
|
|
201
|
+
},
|
|
202
|
+
"minifySVG": {
|
|
203
|
+
"description": "Minify SVG elements (uses SVGO)",
|
|
204
|
+
"type": [
|
|
205
|
+
"boolean",
|
|
206
|
+
"object"
|
|
207
|
+
]
|
|
208
|
+
},
|
|
209
|
+
"minifyURLs": {
|
|
210
|
+
"description": "Minify URLs in various attributes",
|
|
211
|
+
"type": [
|
|
212
|
+
"boolean",
|
|
213
|
+
"string",
|
|
214
|
+
"object"
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
"noNewlinesBeforeTagClose": {
|
|
218
|
+
"description": "Never split a line in a tag that closes an element—use with `--max-line-length`",
|
|
219
|
+
"type": "boolean"
|
|
220
|
+
},
|
|
221
|
+
"partialMarkup": {
|
|
222
|
+
"description": "Treat input as a partial HTML fragment, preserving stray end tags and unclosed tags",
|
|
223
|
+
"type": "boolean"
|
|
224
|
+
},
|
|
225
|
+
"preserveLineBreaks": {
|
|
226
|
+
"description": "Always collapse to one line break (never remove it entirely) when whitespace between tags includes a line break—use with `--collapse-whitespace`",
|
|
227
|
+
"type": "boolean"
|
|
228
|
+
},
|
|
229
|
+
"preventAttributesEscaping": {
|
|
230
|
+
"description": "Prevents the escaping of the values of attributes",
|
|
231
|
+
"type": "boolean"
|
|
232
|
+
},
|
|
233
|
+
"processScripts": {
|
|
234
|
+
"description": "Array of strings corresponding to types of `script` elements to process through minifier (e.g., `text/ng-template`, `text/x-handlebars-template`, etc.)",
|
|
235
|
+
"type": [
|
|
236
|
+
"string",
|
|
237
|
+
"array"
|
|
238
|
+
],
|
|
239
|
+
"items": {
|
|
240
|
+
"type": "string"
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"quoteCharacter": {
|
|
244
|
+
"description": "Type of quote to use for attribute values (`'` or `\"`)",
|
|
245
|
+
"type": "string"
|
|
246
|
+
},
|
|
247
|
+
"removeAttributeQuotes": {
|
|
248
|
+
"description": "Remove quotes around attributes when possible",
|
|
249
|
+
"type": "boolean"
|
|
250
|
+
},
|
|
251
|
+
"removeComments": {
|
|
252
|
+
"description": "Strip HTML comments",
|
|
253
|
+
"type": "boolean"
|
|
254
|
+
},
|
|
255
|
+
"removeDefaultTypeAttributes": {
|
|
256
|
+
"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",
|
|
257
|
+
"type": "boolean"
|
|
258
|
+
},
|
|
259
|
+
"removeEmptyAttributes": {
|
|
260
|
+
"description": "Remove all attributes with whitespace-only values",
|
|
261
|
+
"type": "boolean"
|
|
262
|
+
},
|
|
263
|
+
"removeEmptyElements": {
|
|
264
|
+
"description": "Remove all elements with empty contents",
|
|
265
|
+
"type": "boolean"
|
|
266
|
+
},
|
|
267
|
+
"removeEmptyElementsExcept": {
|
|
268
|
+
"description": "Array of elements to preserve (e.g., `td`, `<i class=\"test\">`, etc.)—use with `--remove-empty-elements`",
|
|
269
|
+
"type": [
|
|
270
|
+
"string",
|
|
271
|
+
"array"
|
|
272
|
+
],
|
|
273
|
+
"items": {
|
|
274
|
+
"type": "string"
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
"removeOptionalTags": {
|
|
278
|
+
"description": "Remove optional tags",
|
|
279
|
+
"type": "boolean"
|
|
280
|
+
},
|
|
281
|
+
"removeRedundantAttributes": {
|
|
282
|
+
"description": "Remove attributes when value matches default or has no effect (as well as `rel` keywords and `meta` elements without effect)",
|
|
283
|
+
"type": "boolean"
|
|
284
|
+
},
|
|
285
|
+
"removeTagWhitespace": {
|
|
286
|
+
"description": "Remove space between attributes whenever possible; note that this will result in invalid HTML",
|
|
287
|
+
"type": "boolean"
|
|
288
|
+
},
|
|
289
|
+
"removeUnusedCSS": {
|
|
290
|
+
"description": "Remove CSS from `style` elements that name an element, class, or ID the document doesn’t reference—use with `--minify-css`, and `{\"safelist\": […]}` for names only external scripts use",
|
|
291
|
+
"type": [
|
|
292
|
+
"boolean",
|
|
293
|
+
"object"
|
|
294
|
+
]
|
|
295
|
+
},
|
|
296
|
+
"selfCloseForeignElements": {
|
|
297
|
+
"description": "Self-close empty SVG and MathML elements (e.g., `<path d=\"…\"></path>` → `<path d=\"…\"/>`)",
|
|
298
|
+
"type": "boolean"
|
|
299
|
+
},
|
|
300
|
+
"sortAttributes": {
|
|
301
|
+
"description": "Sort attributes by frequency",
|
|
302
|
+
"type": "boolean"
|
|
303
|
+
},
|
|
304
|
+
"sortClassNames": {
|
|
305
|
+
"description": "Sort style classes by frequency",
|
|
306
|
+
"type": "boolean"
|
|
307
|
+
},
|
|
308
|
+
"trimCustomFragments": {
|
|
309
|
+
"description": "Trim whitespace around custom fragments (`--ignore-custom-fragments`) where it does not affect the output—use with `--collapse-whitespace`",
|
|
310
|
+
"type": "boolean"
|
|
311
|
+
},
|
|
312
|
+
"strictCustomFragments": {
|
|
313
|
+
"description": "Reject `ignoreCustomFragments` patterns that risk catastrophic backtracking (rather than warning about them)",
|
|
314
|
+
"type": "boolean"
|
|
315
|
+
},
|
|
316
|
+
"useShortDoctype": {
|
|
317
|
+
"description": "Replaces the doctype with the short HTML doctype",
|
|
318
|
+
"type": "boolean"
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
"additionalProperties": false
|
|
322
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,45 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
|
|
2
|
+
"author": "Jens Oliver Meiert",
|
|
3
|
+
"bin": {
|
|
4
|
+
"html-minifier": "cli.js",
|
|
5
|
+
"hm": "cli.js"
|
|
6
|
+
},
|
|
7
|
+
"bugs": "https://github.com/j9t/html-minifier/issues",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"commander": "^15.0.0",
|
|
10
|
+
"entities": "^9.0.0",
|
|
11
|
+
"lightningcss": "^1.33.0",
|
|
12
|
+
"svgo": "^4.1.0",
|
|
13
|
+
"terser": "^5.51.2"
|
|
14
|
+
},
|
|
15
|
+
"description": "Highly effective, super-configurable, well-tested web page minifier",
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@eslint/js": "^10.0.1",
|
|
18
|
+
"@swc/core": "^1.16.21",
|
|
19
|
+
"@types/node": "^26.6.6",
|
|
20
|
+
"eslint": "^10.14.0",
|
|
21
|
+
"globals": "^17.14.0",
|
|
22
|
+
"typescript": "^7.0.2",
|
|
23
|
+
"vite": "^8.3.5"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=22.13"
|
|
27
|
+
},
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/types/htmlminifier.d.ts",
|
|
31
|
+
"import": "./src/htmlminifier.js"
|
|
32
|
+
},
|
|
33
|
+
"./package.json": "./package.json"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"cli.js",
|
|
37
|
+
"dist/types",
|
|
38
|
+
"html-minifier.schema.json",
|
|
39
|
+
"src"
|
|
40
|
+
],
|
|
41
|
+
"funding": "https://github.com/j9t/html-minifier?sponsor=1",
|
|
42
|
+
"homepage": "https://j9t.github.io/html-minifier/",
|
|
5
43
|
"keywords": [
|
|
6
44
|
"cli",
|
|
7
45
|
"compress",
|
|
@@ -10,6 +48,7 @@
|
|
|
10
48
|
"html",
|
|
11
49
|
"htmlmin",
|
|
12
50
|
"javascript",
|
|
51
|
+
"js",
|
|
13
52
|
"min",
|
|
14
53
|
"minification",
|
|
15
54
|
"minifier",
|
|
@@ -18,69 +57,42 @@
|
|
|
18
57
|
"optimizer",
|
|
19
58
|
"pack",
|
|
20
59
|
"packer",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
60
|
+
"svg",
|
|
61
|
+
"svgo",
|
|
62
|
+
"swc",
|
|
63
|
+
"terser",
|
|
23
64
|
"uglifier",
|
|
24
65
|
"uglify"
|
|
25
66
|
],
|
|
26
|
-
"homepage": "https://kangax.github.io/html-minifier/",
|
|
27
|
-
"author": "Juriy \"kangax\" Zaytsev",
|
|
28
|
-
"maintainers": [
|
|
29
|
-
"Alex Lam <alexlamsl@gmail.com>",
|
|
30
|
-
"Juriy Zaytsev <kangax@gmail.com> (http://perfectionkills.com/)"
|
|
31
|
-
],
|
|
32
|
-
"contributors": [
|
|
33
|
-
"Gilmore Davidson (https://github.com/gilmoreorless)",
|
|
34
|
-
"Hugo Wetterberg <hugo@wetterberg.nu>",
|
|
35
|
-
"Zoltan Frombach <tssajo@gmail.com>"
|
|
36
|
-
],
|
|
37
67
|
"license": "MIT",
|
|
38
|
-
"
|
|
39
|
-
|
|
68
|
+
"name": "html-minifier",
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"@swc/core": "^1.15.7"
|
|
71
|
+
},
|
|
72
|
+
"peerDependenciesMeta": {
|
|
73
|
+
"@swc/core": {
|
|
74
|
+
"optional": true
|
|
75
|
+
}
|
|
40
76
|
},
|
|
41
|
-
"main": "src/htmlminifier.js",
|
|
42
77
|
"repository": {
|
|
43
78
|
"type": "git",
|
|
44
|
-
"url": "git+https://github.com/
|
|
45
|
-
},
|
|
46
|
-
"bugs": {
|
|
47
|
-
"url": "https://github.com/kangax/html-minifier/issues"
|
|
48
|
-
},
|
|
49
|
-
"engines": {
|
|
50
|
-
"node": ">=6"
|
|
79
|
+
"url": "git+https://github.com/j9t/html-minifier.git"
|
|
51
80
|
},
|
|
52
81
|
"scripts": {
|
|
53
|
-
"
|
|
54
|
-
"
|
|
82
|
+
"build": "tsc && npm run build:schema",
|
|
83
|
+
"build:docs": "vite build --base /html-minifier/",
|
|
84
|
+
"build:schema": "node scripts/build-schema.js",
|
|
85
|
+
"deploy": "npm run build && npm run build:docs",
|
|
86
|
+
"lint": "eslint .",
|
|
87
|
+
"prebuild": "node --input-type=module --eval \"import {rmSync} from 'fs';rmSync('dist',{recursive:true,force:true})\"",
|
|
88
|
+
"prepack": "npm run build",
|
|
89
|
+
"prepare": "git config core.hooksPath .githooks || true",
|
|
90
|
+
"serve": "vite",
|
|
91
|
+
"test": "npm run test:types && node --test \"test/**/*.test.js\" \"backtest/*.test.js\"",
|
|
92
|
+
"test:types": "tsc --noEmit && tsc --project tsconfig.test.json",
|
|
93
|
+
"test:watch": "node --test --watch \"test/**/*.test.js\" \"backtest/*.test.js\""
|
|
55
94
|
},
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"commander": "^2.19.0",
|
|
60
|
-
"he": "^1.2.0",
|
|
61
|
-
"param-case": "^2.1.1",
|
|
62
|
-
"relateurl": "^0.2.7",
|
|
63
|
-
"uglify-js": "^3.5.1"
|
|
64
|
-
},
|
|
65
|
-
"devDependencies": {
|
|
66
|
-
"grunt": "^1.0.4",
|
|
67
|
-
"grunt-browserify": "^5.3.0",
|
|
68
|
-
"grunt-contrib-uglify": "^4.0.1",
|
|
69
|
-
"grunt-eslint": "^21.0.0",
|
|
70
|
-
"phantomjs-prebuilt": "^2.1.16",
|
|
71
|
-
"qunit": "^2.9.2"
|
|
72
|
-
},
|
|
73
|
-
"benchmarkDependencies": {
|
|
74
|
-
"brotli": "^1.3.2",
|
|
75
|
-
"chalk": "^2.4.2",
|
|
76
|
-
"cli-table": "^0.3.1",
|
|
77
|
-
"lzma": "^2.3.2",
|
|
78
|
-
"minimize": "^2.2.0",
|
|
79
|
-
"progress": "^2.0.3"
|
|
80
|
-
},
|
|
81
|
-
"files": [
|
|
82
|
-
"src/*.js",
|
|
83
|
-
"cli.js",
|
|
84
|
-
"sample-cli-config-file.conf"
|
|
85
|
-
]
|
|
95
|
+
"type": "module",
|
|
96
|
+
"types": "dist/types/htmlminifier.d.ts",
|
|
97
|
+
"version": "5.0.0"
|
|
86
98
|
}
|