html-minifier 5.0.1 → 5.0.3
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/README.md +12 -7
- package/cli.js +91 -32
- package/dist/types/htmlminifier.d.ts.map +1 -1
- package/dist/types/htmlparser.d.ts.map +1 -1
- package/dist/types/lib/attributes.d.ts +3 -1
- package/dist/types/lib/attributes.d.ts.map +1 -1
- package/dist/types/lib/constants.d.ts +5 -1
- package/dist/types/lib/constants.d.ts.map +1 -1
- package/dist/types/lib/elements.d.ts.map +1 -1
- package/dist/types/lib/fragments.d.ts +13 -1
- package/dist/types/lib/fragments.d.ts.map +1 -1
- package/dist/types/lib/options.d.ts +1 -0
- package/dist/types/lib/options.d.ts.map +1 -1
- package/package.json +6 -4
- package/src/htmlminifier.js +182 -72
- package/src/htmlparser.js +309 -24
- package/src/lib/attributes.js +108 -20
- package/src/lib/constants.js +16 -5
- package/src/lib/elements.js +7 -0
- package/src/lib/fragments.js +274 -1
- package/src/lib/options.js +5 -4
package/README.md
CHANGED
|
@@ -175,12 +175,12 @@ Options can be used in config files (camelCase) or via CLI flags (kebab-case wit
|
|
|
175
175
|
| `quoteCharacter`<br>`--quote-character` | Type of quote to use for attribute values (`'` or `"`) | Auto-detected (uses the quote requiring less escaping; defaults to `"` when equal) |
|
|
176
176
|
| `removeAttributeQuotes`<br>`--remove-attribute-quotes` | [Remove quotes around attributes when possible](https://perfectionkills.com/experimenting-with-html-minifier/#remove_attribute_quotes) | `false` |
|
|
177
177
|
| `removeComments`<br>`--remove-comments` | [Strip HTML comments](https://perfectionkills.com/experimenting-with-html-minifier/#remove_comments) | `false` |
|
|
178
|
-
| `removeDefaultTypeAttributes`<br>`--remove-default-type-attributes` | 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 | `false` |
|
|
179
|
-
| `removeEmptyAttributes`<br>`--remove-empty-attributes` | [Remove all attributes with whitespace-only values](https://perfectionkills.com/experimenting-with-html-minifier/#remove_empty_or_blank_attributes) | `false` (could be `true`, `Function(attrName, tag)`) |
|
|
178
|
+
| `removeDefaultTypeAttributes`<br>`--remove-default-type-attributes` | 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, and `type` stays if a `style` element in the document selects on it (external style sheets can’t be checked) | `false` |
|
|
179
|
+
| `removeEmptyAttributes`<br>`--remove-empty-attributes` | [Remove all attributes with whitespace-only values](https://perfectionkills.com/experimenting-with-html-minifier/#remove_empty_or_blank_attributes), unless a `style` element in the document selects on the attribute (external style sheets can’t be checked) | `false` (could be `true`, `Function(attrName, tag)`) |
|
|
180
180
|
| `removeEmptyElements`<br>`--remove-empty-elements` | [Remove all elements with empty contents](#removing-empty-elements) | `false` |
|
|
181
181
|
| `removeEmptyElementsExcept`<br>`--remove-empty-elements-except` | Array of elements to preserve—use with `removeEmptyElements`; accepts simple tag names (e.g., `["td"]`) or HTML-like markup with attributes (e.g., `["<i class='test'>"]`); supports double quotes, single quotes, and unquoted attribute values | `[]` |
|
|
182
182
|
| `removeOptionalTags`<br>`--remove-optional-tags` | [Remove optional tags](https://perfectionkills.com/experimenting-with-html-minifier/#remove_optional_tags) | `false` |
|
|
183
|
-
| `removeRedundantAttributes`<br>`--remove-redundant-attributes` | [Remove attributes when value matches default](https://meiert.com/blog/optional-html/#toc-attribute-values) or has no effect (as well as `rel` keywords and `meta` elements without effect) | `false` |
|
|
183
|
+
| `removeRedundantAttributes`<br>`--remove-redundant-attributes` | [Remove attributes when value matches default](https://meiert.com/blog/optional-html/#toc-attribute-values) or has no effect (as well as `rel` keywords and `meta` elements without effect), unless a `style` element in the document selects on the attribute (external style sheets can’t be checked) | `false` |
|
|
184
184
|
| `removeTagWhitespace`<br>`--remove-tag-whitespace` | Remove space between attributes whenever possible; **note that this will result in invalid HTML** | `false` |
|
|
185
185
|
| `removeUnusedCSS`<br>`--remove-unused-css` | [Remove CSS from `style` elements](#unused-css-removal) that name an element, class, or ID the document doesn’t reference—use with `minifyCSS`, and `safelist` for names only external scripts use | `false` (could be `true`, `{ safelist, scripts }`) |
|
|
186
186
|
| `selfCloseForeignElements`<br>`--self-close-foreign-elements` | Self-close empty SVG and MathML elements (e.g., `<path d="…"></path>` → `<path d="…"/>`) | `false` |
|
|
@@ -256,6 +256,8 @@ you get the following output (condensed, `\n` represents an actual line break):
|
|
|
256
256
|
|
|
257
257
|
Where the modifiers disagree, the preserving one wins—`conservativeCollapse` and `preserveLineBreaks` do not let `collapseInlineTagWhitespace` remove a space or line break entirely.
|
|
258
258
|
|
|
259
|
+
`collapseWhitespace` goes by the element, not by CSS, so whitespace in an element styled `white-space: pre` collapses unless you protect it with [`canCollapseWhitespace` and `canTrimWhitespace`](#api-only-options).
|
|
260
|
+
|
|
259
261
|
Regardless of these options, whitespace at the start and end of the output goes, and so do lines that a removed comment or tag leaves with nothing but whitespace (blank lines of the source stay). Whitespace stays, however, where it’s kept verbatim (in `pre` or `textarea`, or in `pre`, `textarea`, or `script` content left open at the end), next to custom fragments where their handling keeps it (see `trimCustomFragments`), at either end of partial markup (cf. `partialMarkup`), and where `conservativeCollapse` or `preserveLineBreaks` keep it.
|
|
260
262
|
|
|
261
263
|
Note: `preserveLineBreaks` keeps line breaks, not indentation. HTML Minifier doesn’t format: To keep the source formatting, leave `collapseWhitespace` off (as in the first row of the table above). Line breaks and indentation then stay as written, while other options still apply.
|
|
@@ -292,6 +294,7 @@ These figures were measured in October 2026 with HTML Minifier Next 8.8.1 on 61
|
|
|
292
294
|
|
|
293
295
|
`removeEmptyElements` removes elements without content—no text and no child elements (comments don’t count; whitespace does, unless `collapseWhitespace` removes it). It keeps:
|
|
294
296
|
|
|
297
|
+
* `html`, `head`, and `body` elements with attributes (which browsers wouldn’t recreate), and `frameset` elements,
|
|
295
298
|
* elements with an `id` attribute,
|
|
296
299
|
* elements with a `role`, `tabindex`, or ARIA attribute (e.g., `aria-label` or `aria-hidden`), and `label`, `output`, and `template` elements with a `for` attribute (e.g., a `label` styled as a menu toggle), unless its value is empty,
|
|
297
300
|
* custom elements (e.g., `<my-player></my-player>`), `canvas`, and `textarea` elements,
|
|
@@ -600,7 +603,7 @@ The CLI’s `--verbose` and `--dry` modes print the same information to STDERR a
|
|
|
600
603
|
|
|
601
604
|
## Minification comparison
|
|
602
605
|
|
|
603
|
-
Please see [**the Minifier Benchmarks
|
|
606
|
+
Please see [**the Minifier Benchmarks Project**](https://j9t.github.io/minifier-benchmarks/) for details on how HTML Minifier compares to other minifiers. (The benchmarks are currently maintained by the author of HTML Minifier. Contributions, including from other minifier authors, are welcome.)
|
|
604
607
|
|
|
605
608
|
## Examples
|
|
606
609
|
|
|
@@ -695,7 +698,7 @@ By default, HM parses markup into a complete tree structure, then modifies it (r
|
|
|
695
698
|
|
|
696
699
|
_Input markup (e.g., `<p id="">foo`) → Internal representation of markup in a form of tree (e.g., `{ tag: "p", attr: "id", children: ["foo"] }`) → Transformation of internal representation (e.g., removal of `id` attribute) → Output of resulting markup (e.g., `<p>foo</p>`)_
|
|
697
700
|
|
|
698
|
-
For partial HTML fragments (such as template includes, SSI fragments, or closing tags without opening tags), use the `partialMarkup: true` option. This preserves stray end tags and prevents auto-closing of unclosed tags at the end of input. Note that normal HTML auto-closing rules still apply during parsing—for example, a closing parent tag will still auto-close its unclosed child elements. Whitespace at the start and end of a fragment stays, too, as it may separate the fragment from what surrounds it (unless `collapseWhitespace` removes it). `removeRedundantAttributes` keeps `target="_self"` in partial markup, as there may be a `base` element setting another target elsewhere. (Where an external script adds such a `base` element, wrap links whose `target="_self"` needs to stay in `<!-- htmlmin:ignore -->`.)
|
|
701
|
+
For partial HTML fragments (such as template includes, SSI fragments, or closing tags without opening tags), use the `partialMarkup: true` option. This preserves stray end tags and prevents auto-closing of unclosed tags at the end of input. Note that normal HTML auto-closing rules still apply during parsing—for example, a closing parent tag will still auto-close its unclosed child elements, and an end tag browsers ignore because a block element is still open inside its element is removed (use `<!-- htmlmin:ignore -->` to keep such markup as written). Whitespace at the start and end of a fragment stays, too, as it may separate the fragment from what surrounds it (unless `collapseWhitespace` removes it). `removeRedundantAttributes` keeps `target="_self"` in partial markup, as there may be a `base` element setting another target elsewhere. (Where an external script adds such a `base` element, wrap links whose `target="_self"` needs to stay in `<!-- htmlmin:ignore -->`.)
|
|
699
702
|
|
|
700
703
|
Markup with [parse errors](https://html.spec.whatwg.org/multipage/parsing.html#parse-errors) that HM cannot read, like a stray `</>` or an `=` in an unquoted attribute value, makes it abort with the line and column of the error, so that the error can be fixed. With `continueOnParseError`, HM handles such errors the way browsers do instead.
|
|
701
704
|
|
|
@@ -717,6 +720,8 @@ HTML reads CRLF and CR line breaks as line feeds, so HM writes them so, too. Mar
|
|
|
717
720
|
|
|
718
721
|
By default, `ignoreCustomFragments` preserves `<?php … ?>`, `<?= … ?>`, `<? … ?>`, and `<% … %>` blocks (as well as XML declarations), so PHP, ERB, JSP, and ASP templates can be minified as part of a build, with the markup, CSS, and JavaScript around those blocks being minified as usual. For includes and other partials, add `partialMarkup`.
|
|
719
722
|
|
|
723
|
+
CSS and JavaScript are only left as written where a template block starts a rule or statement (`<?php if ($a): ?>` between two statements, `<?= $rules ?>` after a rule, or `<?= $code ?>` after `case 1:`, `default:`, or a label), as it may render as anything or as nothing, or where it sits in an `@charset`, `@import`, or `@namespace` statement that would otherwise be dropped with it (`@import <?= $url ?>;`). Template blocks within values (`color: <?= $color ?>`) are safe—here, the code around them is minified, so a block in code that minification removes (such as an unused rule or dead code) goes with that code. This detection is best-effort, as HTML Minifier doesn’t parse template code. To exempt anything it misses, use [`canMinifyCSS`](#css-minification) or [`canMinifyJS`](#javascript-minification).
|
|
724
|
+
|
|
720
725
|
Whitespace next to template blocks is collapsed but kept, as it may matter once the template renders. `trimCustomFragments` removes it where HTML Minifier would remove whitespace anyway, as between block-level elements: `<ul> <?php foreach ($items as $item): ?> <li>` loses it, `Hello <?= $name ?>!` keeps it. Tags keep the spacing of their source, and whitespace next to template blocks in attribute values, CSS, and JavaScript is always kept.
|
|
721
726
|
|
|
722
727
|
Where pages are rendered ahead of serving, as with static exports or full-page caches, you can also minify the rendered HTML instead, which makes this a non-issue.
|
|
@@ -842,7 +847,7 @@ npm i;
|
|
|
842
847
|
npm run backtest
|
|
843
848
|
```
|
|
844
849
|
|
|
845
|
-
The backtest tool tracks minification performance—output size (raw, Gzip, and Brotli) and processing time—across Git history. Results are saved in the backtest folder (results.json).
|
|
850
|
+
The backtest tool tracks minification performance—output size (raw, Gzip, and Brotli) and processing time—across Git history. Results are saved in the backtest folder (results.json). The corpus (backtest/sites.json) is shared with [the Minifier Benchmarks Project](https://github.com/j9t/minifier-benchmarks)—changing sites requires changing them in both repositories.
|
|
846
851
|
|
|
847
852
|
Parameters:
|
|
848
853
|
|
|
@@ -898,4 +903,4 @@ You might like some of my other work:
|
|
|
898
903
|
|
|
899
904
|
* Optimization tools: [hihtml](https://github.com/j9t/hihtml) · HTML Minifier · [ObsoHTML](https://github.com/j9t/obsohtml) · [CSS Dedup](https://github.com/j9t/css-dedup) · [Image Guard](https://github.com/j9t/image-guard) · [Compressor.js Next](https://github.com/j9t/compressorjs-next) · [.htaccess Punk](https://github.com/j9t/htaccess-punk)
|
|
900
905
|
* Defense tools: [IA Defensa](https://iadefensa.com/solutions/)
|
|
901
|
-
* Resources for quality web development: [Articles](https://meiert.com/topics/development/) · [Books](https://meiert.com/topics/books/) (e.g., [_On Web Development_](https://meiert.com/blog/on-web-development-2/)) · [News](https://
|
|
906
|
+
* Resources for quality web development: [Articles](https://meiert.com/topics/development/) · [Books](https://meiert.com/topics/books/) (e.g., [_On Web Development_](https://meiert.com/blog/on-web-development-2/)) · [News](https://dxsrc.org/) · [Terminology](https://webglossary.info/)
|
package/cli.js
CHANGED
|
@@ -80,12 +80,15 @@ const MARK_RESET = process.stderr.isTTY ? '\x1b[0m' : '';
|
|
|
80
80
|
const program = new Command();
|
|
81
81
|
program.name(pkg.name);
|
|
82
82
|
|
|
83
|
+
// Only the first line, which says what failed, is marked, leaving the reason below it plain
|
|
84
|
+
const printError = (/** @type {string} */ message) => console.error(message.replace(/^.*/, `${MARK_ERROR}$&${MARK_RESET}`));
|
|
85
|
+
|
|
83
86
|
/**
|
|
84
87
|
* @param {string} message
|
|
85
88
|
* @returns {never}
|
|
86
89
|
*/
|
|
87
90
|
function fatal(message) {
|
|
88
|
-
|
|
91
|
+
printError(message);
|
|
89
92
|
process.exit(1);
|
|
90
93
|
}
|
|
91
94
|
|
|
@@ -93,12 +96,22 @@ function fatal(message) {
|
|
|
93
96
|
/** @param {unknown} err */
|
|
94
97
|
const errorMessage = (err) => err instanceof Error ? err.message : String(err);
|
|
95
98
|
|
|
99
|
+
/**
|
|
100
|
+
* What the CLI tried, with the reason it failed indented below, where there is one
|
|
101
|
+
* @param {string} action
|
|
102
|
+
* @param {unknown} err
|
|
103
|
+
*/
|
|
104
|
+
const describeFailure = (action, err) => {
|
|
105
|
+
const reason = errorMessage(err);
|
|
106
|
+
return reason.trim() ? `${action}:\n${reason.replace(/^/gm, ' ')}` : action;
|
|
107
|
+
};
|
|
108
|
+
|
|
96
109
|
// Handle broken pipe (e.g., when piping to `head`)
|
|
97
110
|
process.stdout.on('error', (/** @type {NodeJS.ErrnoException} */ err) => {
|
|
98
111
|
if (err && err.code === 'EPIPE') {
|
|
99
112
|
process.exit(0);
|
|
100
113
|
}
|
|
101
|
-
fatal('STDOUT error
|
|
114
|
+
fatal(describeFailure('STDOUT error', err));
|
|
102
115
|
});
|
|
103
116
|
|
|
104
117
|
/**
|
|
@@ -229,7 +242,7 @@ function readFile(file) {
|
|
|
229
242
|
try {
|
|
230
243
|
return fs.readFileSync(file, { encoding: 'utf8' });
|
|
231
244
|
} catch (err) {
|
|
232
|
-
fatal('Cannot read ' + file
|
|
245
|
+
fatal(describeFailure('Cannot read ' + file, err));
|
|
233
246
|
}
|
|
234
247
|
}
|
|
235
248
|
|
|
@@ -417,10 +430,11 @@ program.helpOption('-h, --help', 'Display help for command');
|
|
|
417
430
|
programOptions.preset = 'comprehensive';
|
|
418
431
|
|
|
419
432
|
const inputDirResolved = await fs.promises.realpath(cwd).catch(() => cwd);
|
|
420
|
-
const stats = await processDirectory(cwd, cwd, EXTENSIONS_DEFAULT, false, false, undefined, Boolean(process.stderr.isTTY), ['node_modules'], inputDirResolved);
|
|
433
|
+
const { stats, failed } = await processDirectory(cwd, cwd, EXTENSIONS_DEFAULT, false, false, undefined, Boolean(process.stderr.isTTY), ['node_modules'], inputDirResolved);
|
|
421
434
|
reportProcessed(stats.length);
|
|
435
|
+
reportFailed(failed);
|
|
422
436
|
|
|
423
|
-
process.exit(
|
|
437
|
+
process.exit();
|
|
424
438
|
}
|
|
425
439
|
}
|
|
426
440
|
|
|
@@ -552,6 +566,18 @@ program.helpOption('-h, --help', 'Display help for command');
|
|
|
552
566
|
console.error(`${MARK_SUCCESS}Processed ${count.toLocaleString()} file${count === 1 ? '' : 's'}.${MARK_RESET}`);
|
|
553
567
|
}
|
|
554
568
|
|
|
569
|
+
/**
|
|
570
|
+
* Ends a directory run on what failed; each failure was reported as it happened, with
|
|
571
|
+
* its reason, so that this needs only name the files
|
|
572
|
+
* @param {string[]} files
|
|
573
|
+
*/
|
|
574
|
+
function reportFailed(files) {
|
|
575
|
+
if (!files.length) return;
|
|
576
|
+
process.exitCode = 1;
|
|
577
|
+
console.error(`${MARK_ERROR}Could not process ${files.length.toLocaleString()} file${files.length === 1 ? '' : 's'}:${MARK_RESET}`);
|
|
578
|
+
files.forEach(file => console.error(` ${file}`));
|
|
579
|
+
}
|
|
580
|
+
|
|
555
581
|
/**
|
|
556
582
|
* Reports a single-output run and writes its result to `--output` or STDOUT; a dry
|
|
557
583
|
* run reports only
|
|
@@ -581,7 +607,7 @@ program.helpOption('-h, --help', 'Display help for command');
|
|
|
581
607
|
await fs.promises.mkdir(path.dirname(programOptions.output), { recursive: true });
|
|
582
608
|
await writeFileAtomic(programOptions.output, minified);
|
|
583
609
|
} catch (err) {
|
|
584
|
-
fatal('Cannot write ' + programOptions.output
|
|
610
|
+
fatal(describeFailure('Cannot write ' + programOptions.output, err));
|
|
585
611
|
}
|
|
586
612
|
return;
|
|
587
613
|
}
|
|
@@ -697,6 +723,7 @@ program.helpOption('-h, --help', 'Display help for command');
|
|
|
697
723
|
}
|
|
698
724
|
|
|
699
725
|
/**
|
|
726
|
+
* Rejects with a message fit to show as is, leaving it to the run what to do about it
|
|
700
727
|
* @param {string} inputFile
|
|
701
728
|
* @param {string} outputFile
|
|
702
729
|
* @param {boolean} [isDryRun]
|
|
@@ -704,7 +731,7 @@ program.helpOption('-h, --help', 'Display help for command');
|
|
|
704
731
|
*/
|
|
705
732
|
async function processFile(inputFile, outputFile, isDryRun = false, isVerbose = false) {
|
|
706
733
|
const data = await fs.promises.readFile(inputFile, { encoding: 'utf8' }).catch(err => {
|
|
707
|
-
|
|
734
|
+
throw new Error(describeFailure('Cannot read ' + inputFile, err));
|
|
708
735
|
});
|
|
709
736
|
|
|
710
737
|
let minified;
|
|
@@ -716,7 +743,7 @@ program.helpOption('-h, --help', 'Display help for command');
|
|
|
716
743
|
}
|
|
717
744
|
minified = await minify(data, fileOptions);
|
|
718
745
|
} catch (err) {
|
|
719
|
-
|
|
746
|
+
throw new Error(describeFailure('Minification error on ' + inputFile, err), { cause: err });
|
|
720
747
|
}
|
|
721
748
|
|
|
722
749
|
const stats = calculateStats(data, minified);
|
|
@@ -727,7 +754,7 @@ program.helpOption('-h, --help', 'Display help for command');
|
|
|
727
754
|
|
|
728
755
|
if (!isDryRun) {
|
|
729
756
|
await writeFileAtomic(outputFile, minified).catch(err => {
|
|
730
|
-
|
|
757
|
+
throw new Error(describeFailure('Cannot write ' + outputFile, err));
|
|
731
758
|
});
|
|
732
759
|
}
|
|
733
760
|
|
|
@@ -884,45 +911,68 @@ program.helpOption('-h, --help', 'Display help for command');
|
|
|
884
911
|
* @param {boolean} showProgress
|
|
885
912
|
* @param {string[]} ignorePatterns
|
|
886
913
|
* @param {string} baseDir
|
|
914
|
+
* @returns {Promise<{stats: {originalSize: number, minifiedSize: number, saved: number}[], failed: string[]}>}
|
|
887
915
|
*/
|
|
888
916
|
async function processDirectory(inputDir, outputDir, extensions, isDryRun, isVerbose, skipRootAbs, showProgress, ignorePatterns, baseDir) {
|
|
889
917
|
// Collect all files first for bounded parallel processing
|
|
890
918
|
const list = await collectFiles(inputDir, extensions, skipRootAbs, ignorePatterns, baseDir);
|
|
891
919
|
const allStats = new Array(list.length);
|
|
892
|
-
|
|
893
|
-
const prepareOutDir = async (/** @type {string} */ inputFile) => {
|
|
894
|
-
const outFile = path.join(outputDir, path.relative(inputDir, inputFile));
|
|
895
|
-
if (!isDryRun) {
|
|
896
|
-
await fs.promises.mkdir(path.dirname(outFile), { recursive: true }).catch(err => {
|
|
897
|
-
fatal('Cannot create directory ' + path.dirname(outFile) + '\n' + errorMessage(err));
|
|
898
|
-
});
|
|
899
|
-
}
|
|
900
|
-
return outFile;
|
|
901
|
-
};
|
|
920
|
+
const allFailed = new Array(list.length);
|
|
902
921
|
|
|
903
922
|
let done = 0;
|
|
904
923
|
const advanceProgress = () => {
|
|
905
924
|
if (showProgress) updateProgress(++done, list.length);
|
|
906
925
|
};
|
|
907
926
|
|
|
927
|
+
const failFile = (/** @type {string} */ inputFile, /** @type {number} */ idx, /** @type {string} */ message) => {
|
|
928
|
+
if (showProgress) clearProgress();
|
|
929
|
+
printError(message);
|
|
930
|
+
allFailed[idx] = inputFile;
|
|
931
|
+
advanceProgress();
|
|
932
|
+
};
|
|
933
|
+
|
|
934
|
+
// The output path, or `null` for a file that just failed for want of its folder
|
|
935
|
+
const prepareOutDir = async (/** @type {string} */ inputFile, /** @type {number} */ idx) => {
|
|
936
|
+
const outFile = path.join(outputDir, path.relative(inputDir, inputFile));
|
|
937
|
+
if (isDryRun) return outFile;
|
|
938
|
+
try {
|
|
939
|
+
await fs.promises.mkdir(path.dirname(outFile), { recursive: true });
|
|
940
|
+
return outFile;
|
|
941
|
+
} catch (err) {
|
|
942
|
+
failFile(inputFile, idx, describeFailure('Cannot create directory ' + path.dirname(outFile), err));
|
|
943
|
+
return null;
|
|
944
|
+
}
|
|
945
|
+
};
|
|
946
|
+
|
|
908
947
|
const pool = await createPool(list);
|
|
909
948
|
if (pool) {
|
|
910
949
|
try {
|
|
911
950
|
const { orderLargestFirst } = await import('./src/lib/file-pool.js');
|
|
912
951
|
const [fileSizes, tasks] = await Promise.all([
|
|
913
952
|
getFileSizes(list),
|
|
914
|
-
Promise.all(list.map(async (inputFile, idx) => ({ inputFile, outFile: await prepareOutDir(inputFile), idx })))
|
|
953
|
+
Promise.all(list.map(async (inputFile, idx) => ({ inputFile, outFile: await prepareOutDir(inputFile, idx), idx })))
|
|
915
954
|
]);
|
|
916
955
|
// `run()` queues synchronously, so the files reach the pool in exactly this order
|
|
917
956
|
await Promise.all(orderLargestFirst(tasks, fileSizes).map(async ({ inputFile, outFile, idx }) => {
|
|
957
|
+
if (outFile === null) return;
|
|
918
958
|
const sizes = await pool.run({ inputFile, outputFile: outFile, dryRun: isDryRun })
|
|
919
959
|
.catch(err => {
|
|
960
|
+
// Only a pool that lost a worker names no step, which no file is to blame
|
|
961
|
+
// for and which leaves nothing to run the remaining files on
|
|
962
|
+
if (!err?.stage) {
|
|
963
|
+
if (showProgress) clearProgress();
|
|
964
|
+
reportFailed(allFailed.filter(Boolean));
|
|
965
|
+
fatal(describeFailure('Worker thread failure, stopping the run', err));
|
|
966
|
+
}
|
|
920
967
|
// A worker names the step it failed at, so the wording matches what this
|
|
921
968
|
// file would have got had it been minified in this process
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
969
|
+
const action = err.stage === 'read' ? 'Cannot read ' + inputFile
|
|
970
|
+
: err.stage === 'write' ? 'Cannot write ' + outFile
|
|
971
|
+
: 'Minification error on ' + inputFile;
|
|
972
|
+
failFile(inputFile, idx, describeFailure(action, err));
|
|
973
|
+
return null;
|
|
925
974
|
});
|
|
975
|
+
if (!sizes) return;
|
|
926
976
|
const stats = calculateSizeStats(sizes.originalSize, sizes.minifiedSize);
|
|
927
977
|
if (isDryRun || isVerbose) {
|
|
928
978
|
reportFileStats(path.relative(process.cwd(), inputFile), stats);
|
|
@@ -935,13 +985,18 @@ program.helpOption('-h, --help', 'Display help for command');
|
|
|
935
985
|
}
|
|
936
986
|
} else {
|
|
937
987
|
await runWithConcurrency(list, CONCURRENCY_IN_PROCESS, async (inputFile, idx) => {
|
|
938
|
-
const outFile = await prepareOutDir(inputFile);
|
|
939
|
-
|
|
940
|
-
|
|
988
|
+
const outFile = await prepareOutDir(inputFile, idx);
|
|
989
|
+
if (outFile === null) return;
|
|
990
|
+
try {
|
|
991
|
+
allStats[idx] = await processFile(inputFile, outFile, isDryRun, isVerbose);
|
|
992
|
+
advanceProgress();
|
|
993
|
+
} catch (err) {
|
|
994
|
+
failFile(inputFile, idx, errorMessage(err));
|
|
995
|
+
}
|
|
941
996
|
});
|
|
942
997
|
}
|
|
943
998
|
if (showProgress) clearProgress();
|
|
944
|
-
return allStats.filter(Boolean);
|
|
999
|
+
return { stats: allStats.filter(Boolean), failed: allFailed.filter(Boolean) };
|
|
945
1000
|
}
|
|
946
1001
|
|
|
947
1002
|
const writeMinify = async () => {
|
|
@@ -957,7 +1012,7 @@ program.helpOption('-h, --help', 'Display help for command');
|
|
|
957
1012
|
const minify = await getMinify();
|
|
958
1013
|
minified = await minify(content, minifierOptions);
|
|
959
1014
|
} catch (err) {
|
|
960
|
-
fatal('Minification error
|
|
1015
|
+
fatal(describeFailure('Minification error', err));
|
|
961
1016
|
}
|
|
962
1017
|
|
|
963
1018
|
await reportAndWrite(program.args.length > 0 ? program.args.join(', ') : 'STDIN', content, minified);
|
|
@@ -1025,13 +1080,13 @@ program.helpOption('-h, --help', 'Display help for command');
|
|
|
1025
1080
|
fatal(`${inputDir} is not a directory—to minify a single file, use \`--input\`/\`--output\`: html-minifier [options] -i ${inputDir} -o <output-file>`);
|
|
1026
1081
|
}
|
|
1027
1082
|
} catch (err) {
|
|
1028
|
-
fatal('Cannot read directory ' + inputDir
|
|
1083
|
+
fatal(describeFailure('Cannot read directory ' + inputDir, err));
|
|
1029
1084
|
}
|
|
1030
1085
|
|
|
1031
1086
|
// Resolve base directory for consistent path comparisons
|
|
1032
1087
|
const inputDirResolved = inputReal || inputDir;
|
|
1033
1088
|
|
|
1034
|
-
const stats = await processDirectory(inputDir, outputDir, extList, Boolean(programOptions.dry), Boolean(isVerbose), skipRootAbs, showProgress, ignorePatterns, inputDirResolved);
|
|
1089
|
+
const { stats, failed } = await processDirectory(inputDir, outputDir, extList, Boolean(programOptions.dry), Boolean(isVerbose), skipRootAbs, showProgress, ignorePatterns, inputDirResolved);
|
|
1035
1090
|
|
|
1036
1091
|
if (showProgress) {
|
|
1037
1092
|
reportProcessed(stats.length);
|
|
@@ -1047,6 +1102,8 @@ program.helpOption('-h, --help', 'Display help for command');
|
|
|
1047
1102
|
if (isVerbose) {
|
|
1048
1103
|
await printCacheStats();
|
|
1049
1104
|
}
|
|
1105
|
+
|
|
1106
|
+
reportFailed(failed);
|
|
1050
1107
|
})();
|
|
1051
1108
|
} else if (filesProvided) { // Minifying one or more files specified on the command line
|
|
1052
1109
|
// Process each file independently, then concatenate outputs
|
|
@@ -1068,13 +1125,13 @@ program.helpOption('-h, --help', 'Display help for command');
|
|
|
1068
1125
|
const outputs = new Array(inputs.length);
|
|
1069
1126
|
|
|
1070
1127
|
await runWithConcurrency(inputs, CONCURRENCY_IN_PROCESS, async (file, idx) => {
|
|
1071
|
-
const data = await fs.promises.readFile(file, 'utf8').catch(err => fatal('Cannot read ' + file
|
|
1128
|
+
const data = await fs.promises.readFile(file, 'utf8').catch(err => fatal(describeFailure('Cannot read ' + file, err)));
|
|
1072
1129
|
const minify = await getMinify();
|
|
1073
1130
|
let out;
|
|
1074
1131
|
try {
|
|
1075
1132
|
out = await minify(data, minifierOptions);
|
|
1076
1133
|
} catch (err) {
|
|
1077
|
-
fatal('Minification error on ' + file
|
|
1134
|
+
fatal(describeFailure('Minification error on ' + file, err));
|
|
1078
1135
|
}
|
|
1079
1136
|
originals[idx] = data;
|
|
1080
1137
|
outputs[idx] = out;
|
|
@@ -1083,6 +1140,8 @@ program.helpOption('-h, --help', 'Display help for command');
|
|
|
1083
1140
|
await reportAndWrite(capturedFiles.join(', '), originals.join(''), outputs.join(''));
|
|
1084
1141
|
process.exit(0);
|
|
1085
1142
|
} else { // Minifying input coming from STDIN
|
|
1143
|
+
if (process.stdin.isTTY && process.argv.length === 2) program.help();
|
|
1144
|
+
|
|
1086
1145
|
content = '';
|
|
1087
1146
|
process.stdin.setEncoding('utf8');
|
|
1088
1147
|
process.stdin.on('data', function (/** @type {string} */ data) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htmlminifier.d.ts","sourceRoot":"","sources":["../../src/htmlminifier.js"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"htmlminifier.d.ts","sourceRoot":"","sources":["../../src/htmlminifier.js"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAsF/D,YAAkB,aAAa,GAI/B;IAAe,IAAI,EAAZ,MAAM,CACb;IAAgB,KAAK,AAArB,CACA,EADO,MAAM,CACb;IAAgB,KAAK,AAArB,CACA,EADO,MAAM,CACb;IAAgB,YAAY,AAA5B,CACA,EADO,MAAM,CACb;IAAgB,UAAU,AAA1B,CACA,EADO,MAAM,CACb;IAAgB,WAAW,AAA3B,CAA4B,EAArB,MAAM,CAAe;CAAA,CAAA;AAI5B,YAAkB,eAAe,GAIjC;;;;;;;IAA2G,qBAAqB,AAAhI,CAMA,EANO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,qBAAqB,EAAE,CAAC,GAAG,EAAE,MAAM,KA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;IAAE,GAAG,EAAE,UAAU,CAAC;IAAC,EAAE,EAAE,UAAU,CAAC;IAAC,GAAG,EAAE,UAAU,CAAA;CAAE,CAQhE;AAuFD;;;;GAIG;AACH,eAAO,MAAM,MAAM,UAJR,MAAM,YACN,eAAe,KACb,OAAO,CAAC,MAAM,CAyE1B,CAAC;AAEF,OAAO,EACL,OAAO,EACP,SAAS,EACT,cAAc,EACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"htmlparser.d.ts","sourceRoot":"","sources":["../../src/htmlparser.js"],"names":[],"mappings":"AAmBG,YAgBG,iBAAiB,GAhBV;IACR,KAAK,CAAC,WAAW;IACjB,GAAG,CAAC,WAAW;IACf,KAAK,CAAC,WAAW;IACjB,OAAO,CAAC,WAAW;IACnB,qBAAqB,CAAC,WAAW;IACjC,OAAO,CAAC,WAAW;IACnB,QAAQ,CAAC,WAAW;IACpB,UAAU,CAAC,EAAE,WAAW,SAAS,CAAC;IAClC,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3C,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,SAAS,CAAC;IAC5C,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;CACxC,CAAmB;
|
|
1
|
+
{"version":3,"file":"htmlparser.d.ts","sourceRoot":"","sources":["../../src/htmlparser.js"],"names":[],"mappings":"AAmBG,YAgBG,iBAAiB,GAhBV;IACR,KAAK,CAAC,WAAW;IACjB,GAAG,CAAC,WAAW;IACf,KAAK,CAAC,WAAW;IACjB,OAAO,CAAC,WAAW;IACnB,qBAAqB,CAAC,WAAW;IACjC,OAAO,CAAC,WAAW;IACnB,QAAQ,CAAC,WAAW;IACpB,UAAU,CAAC,EAAE,WAAW,SAAS,CAAC;IAClC,oBAAoB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC3C,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC,YAAY,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACnC,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,kBAAkB,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,SAAS,CAAC;IAC5C,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAA;CACxC,CAAmB;AAgTvB,qBAAa,UAAU;IAMd,IAAI;IACJ,OAAO;IANd;;;OAGG;IACH,YAAY,IAAI,EAHL,MAGK,EAAE,OAAO,EAFd,iBAEc,EAGxB;IAEK,KAAK,kBA4rCV;CACF"}
|
|
@@ -73,15 +73,17 @@ declare function normalizeAttr(attr: HTMLAttribute, attrs: HTMLAttribute[], tag:
|
|
|
73
73
|
} | undefined;
|
|
74
74
|
/**
|
|
75
75
|
* @param {{name: string, value: string | undefined, attr: HTMLAttribute}} normalized
|
|
76
|
+
* @param {string} tag
|
|
76
77
|
* @param {string | boolean | undefined} hasUnarySlash
|
|
77
78
|
* @param {ProcessedOptions} options
|
|
78
79
|
* @param {boolean} isLast
|
|
79
80
|
* @param {string | undefined} uidAttr
|
|
81
|
+
* @param {string[]} markers - What custom fragment and `htmlmin:ignore` placeholders hold
|
|
80
82
|
*/
|
|
81
83
|
declare function buildAttr(normalized: {
|
|
82
84
|
name: string;
|
|
83
85
|
value: string | undefined;
|
|
84
86
|
attr: HTMLAttribute;
|
|
85
|
-
}, hasUnarySlash: string | boolean | undefined, options: ProcessedOptions, isLast: boolean, uidAttr: string | undefined): string;
|
|
87
|
+
}, tag: string, hasUnarySlash: string | boolean | undefined, options: ProcessedOptions, isLast: boolean, uidAttr: string | undefined, markers: string[]): string;
|
|
86
88
|
export { isIgnoredComment, isExecutableScript, isStyleElement, isMetaWithoutEffect, hasAttrName, normalizeAttr, buildAttr, deduplicateAttributes, replaceContentTypePragma };
|
|
87
89
|
//# sourceMappingURL=attributes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../src/lib/attributes.js"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../src/lib/attributes.js"],"names":[],"mappings":"AAAA;;GAEG;AAsCC,OAAQ,KAAA,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAGjD,YAA0I,aAAa,GAA7I;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAE1I;AA8BD;;;GAGG;AACH,iBAAS,gBAAgB,CAAC,IAAI,EAHnB,MAGmB,EAAE,OAAO,EAF5B,gBAE4B,WAOtC;AAuCD;;;;;;;GAOG;AACH,iBAAS,qBAAqB,CAAC,KAAK,EAJzB,aAAa,EAIY,EAAE,aAAa,EAHxC,OAGwC,GAFtC,aAAa,EAAE,CAqB3B;AAoND;;;GAGG;AACH,iBAAS,kBAAkB,CAAC,GAAG,EAHpB,MAGoB,EAAE,KAAK,EAF3B,aAAa,EAEc,WAUrC;AAOD;;;GAGG;AACH,iBAAS,cAAc,CAAC,GAAG,EAHhB,MAGgB,EAAE,KAAK,EAFvB,aAAa,EAEU,WAUjC;AAkLD;;;;;GAKG;AACH,iBAAS,mBAAmB,CAAC,KAAK,EAHvB,aAAa,EAGU,EAAE,OAAO,EAFhC,MAAM,EAE0B,WAkB1C;AA0BD;;;;;GAKG;AACH,iBAAS,wBAAwB,CAAC,KAAK,EAH5B,aAAa,EAGe,EAAE,OAAO,EAFrC,MAAM,EAE+B,QAe/C;AAmDD;;;GAGG;AACH,iBAAS,WAAW,CAAC,IAAI,EAHd,MAGc,EAAE,KAAK,EAFrB,aAAa,EAEQ,WAO/B;AAyUD;;;;;;;;GAQG;AACH,iBAAS,aAAa,CAAC,IAAI,EARhB,aAQgB,EAAE,KAAK,EAPvB,aAAa,EAOU,EAAE,GAAG,EAN5B,MAM4B,EAAE,MAAM,EALpC,MAKoC,EAAE,OAAO,EAJ7C,gBAI6C,EAAE,UAAU,UAAA,EAAE,OAAO,AAF1E,CACF,EADU,MAAM,EAE4D;;;;;;;;cAkB5E;AAuED;;;;;;;;GAQG;AACH,iBAAS,SAAS,CAAC,UAAU,EARlB;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,IAAI,EAAE,aAAa,CAAA;CAQ3C,EAAE,GAAG,EAPvB,MAOuB,EAAE,aAAa,EANtC,MAAM,GAAG,OAAO,GAAG,SAMmB,EAAE,OAAO,EAL/C,gBAK+C,EAAE,MAAM,EAJvD,OAIuD,EAAE,OAAO,EAHhE,MAAM,GAAG,SAGuD,EAAE,OAAO,EAFzE,MAAM,EAEmE,UA0HnF;AAED,OAAO,EAEL,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,WAAW,EAGX,aAAa,EACb,SAAS,EACT,qBAAqB,EACrB,wBAAwB,EACzB,CAAC"}
|
|
@@ -24,10 +24,14 @@ declare const RE_XML_ESCAPE_ATTR: RegExp;
|
|
|
24
24
|
declare const RE_ESCAPE_LT_RAW_TEXT: Record<string, RegExp>;
|
|
25
25
|
declare const RE_HTML_ENCODING: RegExp;
|
|
26
26
|
declare const RE_DOCTYPE: RegExp;
|
|
27
|
+
declare const RE_DOCTYPE_SEGMENT: RegExp;
|
|
27
28
|
declare const RE_ATTR_WS_CHECK: RegExp;
|
|
28
29
|
declare const RE_ATTR_WS_COLLAPSE: RegExp;
|
|
29
30
|
declare const RE_WS_CHAR: RegExp;
|
|
30
31
|
declare const RE_STYLE_ELEMENT: RegExp;
|
|
32
|
+
declare const RE_STYLE_TAG: RegExp;
|
|
33
|
+
declare const RE_ENDS_COLLAPSIBLE: RegExp;
|
|
34
|
+
declare const RE_ATTR_SELECTOR: RegExp;
|
|
31
35
|
declare const RE_EMPTY_ATTRIBUTE: RegExp;
|
|
32
36
|
declare const inlineElementsToKeepWhitespaceAround: Set<string>;
|
|
33
37
|
declare const inlineElementsToKeepWhitespaceWithin: Set<string>;
|
|
@@ -417,5 +421,5 @@ declare const svgoPluginsInline: {
|
|
|
417
421
|
};
|
|
418
422
|
}[];
|
|
419
423
|
declare const namesForeignMixedCase: Map<string, string>;
|
|
420
|
-
export { RE_WS_START, RE_WS_END, RE_WS_ONLY, RE_WS_NBSP_END, RE_ALL_WS_NBSP, RE_NBSP_LEADING_GROUP, RE_NBSP_LEAD_GROUP, RE_NBSP_TRAILING_GROUP, RE_NBSP_TRAILING_STRIP, RE_EVENT_ATTR_DEFAULT, RE_CAN_REMOVE_ATTR_QUOTES, RE_TRAILING_SEMICOLON, RE_AMP_REFERENCE_ATTR, RE_CR, RE_LINE_BREAK_CR, RE_LEGACY_ENTITIES, RE_ESCAPE_LT, RE_BASE_ELEMENT, RE_ESCAPE_LT_RAW_TEXT, RE_XML_ESCAPE_TEXT, RE_XML_ESCAPE_ATTR, RE_HTML_ENCODING, RE_DOCTYPE, RE_ATTR_WS_CHECK, RE_ATTR_WS_COLLAPSE, RE_WS_CHAR, RE_STYLE_ELEMENT, RE_EMPTY_ATTRIBUTE, formattingElements, inlineElementsToKeepWhitespaceAround, inlineElementsToKeepWhitespaceWithin, inlineElementsToKeepWhitespaceBetween, inlineElementsToKeepWhitespaceBetweenEnd, inlineElementsTransparent, inlineElementsTransparentAfter, inlineElementsToKeepWhitespace, processingInstructionTag, formControlElementsEither, toEndTags, generalDefaults, tagDefaults, metaHttpEquivNoEffect, metaNamesNoEffect, targetSelfElements, integrationPointsForeign, tagDefaultsSVG, svgElementsInheritingByReference, namespaceHTML, namespaceSVG, namespaceMathML, namespaceXLink, executableScriptsMimetypes, keepScriptsMimetypes, jsonScriptTypes, isSimpleBoolean, isBooleanValue, collapsibleValues, srcsetElements, MISSING_DEPENDENCY, namesForeignMixedCase, svgoPluginsInline, optionalStartTags, optionalEndTags, headerElements, descriptionElements, pBlockElements, pClosingParents, rubyEndTagOmission, rubyRtcEndTagOmission, optionElements, tableContentElements, tableSectionElements, cellElements, topLevelElements, compactElements, looseElements, trailingElements, htmlElements, quirksPublicIds, quirksSystemIds, quirksPublicIdPrefixes, quirksPublicIdPrefixesNoSystemId, specialContentElements, genericRawTextElements, endlessRawTextElements, escapableRawTextElements, rawTextElements };
|
|
424
|
+
export { RE_WS_START, RE_WS_END, RE_WS_ONLY, RE_WS_NBSP_END, RE_ALL_WS_NBSP, RE_NBSP_LEADING_GROUP, RE_NBSP_LEAD_GROUP, RE_NBSP_TRAILING_GROUP, RE_NBSP_TRAILING_STRIP, RE_EVENT_ATTR_DEFAULT, RE_CAN_REMOVE_ATTR_QUOTES, RE_TRAILING_SEMICOLON, RE_AMP_REFERENCE_ATTR, RE_CR, RE_LINE_BREAK_CR, RE_LEGACY_ENTITIES, RE_ESCAPE_LT, RE_ATTR_SELECTOR, RE_ENDS_COLLAPSIBLE, RE_BASE_ELEMENT, RE_ESCAPE_LT_RAW_TEXT, RE_XML_ESCAPE_TEXT, RE_XML_ESCAPE_ATTR, RE_HTML_ENCODING, RE_DOCTYPE, RE_DOCTYPE_SEGMENT, RE_ATTR_WS_CHECK, RE_ATTR_WS_COLLAPSE, RE_WS_CHAR, RE_STYLE_ELEMENT, RE_STYLE_TAG, RE_EMPTY_ATTRIBUTE, formattingElements, inlineElementsToKeepWhitespaceAround, inlineElementsToKeepWhitespaceWithin, inlineElementsToKeepWhitespaceBetween, inlineElementsToKeepWhitespaceBetweenEnd, inlineElementsTransparent, inlineElementsTransparentAfter, inlineElementsToKeepWhitespace, processingInstructionTag, formControlElementsEither, toEndTags, generalDefaults, tagDefaults, metaHttpEquivNoEffect, metaNamesNoEffect, targetSelfElements, integrationPointsForeign, tagDefaultsSVG, svgElementsInheritingByReference, namespaceHTML, namespaceSVG, namespaceMathML, namespaceXLink, executableScriptsMimetypes, keepScriptsMimetypes, jsonScriptTypes, isSimpleBoolean, isBooleanValue, collapsibleValues, srcsetElements, MISSING_DEPENDENCY, namesForeignMixedCase, svgoPluginsInline, optionalStartTags, optionalEndTags, headerElements, descriptionElements, pBlockElements, pClosingParents, rubyEndTagOmission, rubyRtcEndTagOmission, optionElements, tableContentElements, tableSectionElements, cellElements, topLevelElements, compactElements, looseElements, trailingElements, htmlElements, quirksPublicIds, quirksSystemIds, quirksPublicIdPrefixes, quirksPublicIdPrefixesNoSystemId, specialContentElements, genericRawTextElements, endlessRawTextElements, escapableRawTextElements, rawTextElements };
|
|
421
425
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/constants.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH,QAAA,MAAM,WAAW,QAAkB,CAAC;AACpC,QAAA,MAAM,SAAS,QAAkB,CAAC;AAClC,QAAA,MAAM,UAAU,QAAmB,CAAC;AACpC,QAAA,MAAM,cAAc,QAAqB,CAAC;AAC1C,QAAA,MAAM,cAAc,QAAsB,CAAC;AAC3C,QAAA,MAAM,qBAAqB,QAAuB,CAAC;AACnD,QAAA,MAAM,kBAAkB,QAAqB,CAAC;AAC9C,QAAA,MAAM,sBAAsB,QAAqB,CAAC;AAClD,QAAA,MAAM,sBAAsB,QAAc,CAAC;AAC3C,QAAA,MAAM,qBAAqB,QAAkB,CAAC;AAC9C,QAAA,MAAM,yBAAyB,QAA0B,CAAC;AAC1D,Q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KAAK,EACL,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,kBAAkB,EAGlB,kBAAkB,EAClB,oCAAoC,EACpC,oCAAoC,EACpC,qCAAqC,EACrC,wCAAwC,EACxC,yBAAyB,EACzB,8BAA8B,EAC9B,8BAA8B,EAC9B,wBAAwB,EACxB,yBAAyB,EACzB,SAAS,EAGT,eAAe,EACf,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,cAAc,EACd,gCAAgC,EAChC,aAAa,EACb,YAAY,EACZ,eAAe,EACf,cAAc,EAGd,0BAA0B,EAC1B,oBAAoB,EACpB,eAAe,EAGf,eAAe,EACf,cAAc,EACd,iBAAiB,EAGjB,cAAc,EACd,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EAGjB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,YAAY,EAGZ,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,gCAAgC,EAGhC,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,eAAe,EAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../src/lib/elements.js"],"names":[],"mappings":"AAAA;;GAEG;AAeC,OAAQ,KAAA,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAQ,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AAK,EAAE,qCAAkC,IAAI,CAAA;CAAC,CAAC,CAc/E;AAED;;;;;GAKG;AACH,iBAAS,0BAA0B,CAAC,GAAG,EAL5B,MAK4B,EAAE,KAAK,EAJnC,aAAa,EAIsB,EAAE,YAAY,EAHjD,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,qCAAkC,IAAI,CAAA;CAAC,CAGjB,GAF/C,OAAO,CA8BnB;AAED,OAAO,EAEL,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EAGrB,gBAAgB,EAChB,8BAA8B,EAC9B,0BAA0B,EAC3B,CAAC"}
|
|
@@ -43,5 +43,17 @@ declare function toFragment(pattern: RegExp): DelimitedFragment | PatternFragmen
|
|
|
43
43
|
* @returns {string}
|
|
44
44
|
*/
|
|
45
45
|
declare function replaceCustomFragments(value: string, fragments: (DelimitedFragment | PatternFragment)[], replacer: (match: string) => string): string;
|
|
46
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Whether minified CSS or JavaScript can stand in for its source. A fragment starting a
|
|
48
|
+
* statement or rule can render as anything, or as nothing, while engines read it as an
|
|
49
|
+
* identifier or selector and join it with the code around it, or drop it; a fragment in
|
|
50
|
+
* an at-rule Lightning CSS cannot read would go with that at-rule
|
|
51
|
+
* @param {string} source
|
|
52
|
+
* @param {unknown} output - Anything but a string, from a minifier of one’s own, passes
|
|
53
|
+
* @param {RegExp} placeholder - Global pattern matching one fragment placeholder
|
|
54
|
+
* @param {boolean} [isJS] - Whether the code is JavaScript rather than CSS
|
|
55
|
+
* @returns {boolean}
|
|
56
|
+
*/
|
|
57
|
+
declare function isMinifiedCodeSafe(source: string, output: unknown, placeholder: RegExp, isJS?: boolean): boolean;
|
|
58
|
+
export { toDelimitedFragment, toFragment, replaceCustomFragments, isMinifiedCodeSafe };
|
|
47
59
|
//# sourceMappingURL=fragments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fragments.d.ts","sourceRoot":"","sources":["../../../src/lib/fragments.js"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"fragments.d.ts","sourceRoot":"","sources":["../../../src/lib/fragments.js"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA0BA,YAA4F,iBAAiB,GAAnG;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CAAC,CAI1F;AAAA,YAAoE,eAAe,GAAzE;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAAC,CAGpE;AAmCD;;;;;GAKG;AACH,iBAAS,mBAAmB,CAAC,OAAO,EAJzB,MAIyB,GAHvB,iBAAiB,GAAG,IAAI,CAwBpC;AA8CD;;;;GAIG;AACH,iBAAS,UAAU,CAAC,OAAO,EAHhB,MAGgB,GAFd,iBAAiB,GAAG,eAAe,CAa/C;AAED;;;;;;;GAOG;AACH,iBAAS,sBAAsB,CAAC,KAAK,EAN1B,MAM0B,EAAE,SAAS,EALrC,CAAC,iBAAiB,GAAG,eAAe,CAAC,EAKA,EAAE,QAAQ,EAH/C,CAAC,KAAK,EAAE,MAAM,KAAK,MAG4B,GAF7C,MAAM,CA2KlB;AA2OD;;;;;;;;;;GAUG;AACH,iBAAS,kBAAkB,CAAC,MAAM,EANvB,MAMuB,EAAE,MAAM,EAL/B,OAK+B,EAAE,WAAW,EAJ5C,MAI4C,EAAE,IAAI,AAH1D,CACA,EADQ,OAG0D,GAFxD,OAAO,CAenB;AAED,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,sBAAsB,EACtB,kBAAkB,EACnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","source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AAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,gBAAgB,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CAClC,CAAkB;AA+BtB,wCAAwC;AACxC,iBAAS,qBAAqB,CAAC,OAAO,EAD1B,gBAC0B,WAWrC;AA0BD,QAAA,MAAM,eAAe,aAA0H,CAAC;AAyB7I,YAAkB,gBAAgB,GAM3B,gBAAgB,EAAE,CAAC;AAZ7B;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,kBAAkB;;;sBAhBV,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;;;;;;IAoChC,CAAC;AAqGF;;;;GAIG;AACH,QAAA,MAAM,cAAc,iBAJT,eAAe,kGACf;IAAC,eAAe,WAAW;IAAC,SAAS,WAAW;IAAC,MAAM,WAAW;IAAC,OAAO,WAAW;IAAC,cAAc,EAAE,GAAG,CAAC;IAAC,aAAa,EAAE,GAAG,CAAC;IAAC,cAAc,EAAE,GAAG,CAAA;CAAC,KACjJ,gBAmiBZ,CAAC;AAEF,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,cAAc,EACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
},
|
|
7
7
|
"bugs": "https://github.com/j9t/html-minifier/issues",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"commander": "^15.
|
|
9
|
+
"commander": "^15.1.0",
|
|
10
10
|
"entities": "^9.0.0",
|
|
11
11
|
"lightningcss": "^1.33.0",
|
|
12
12
|
"svgo": "^4.1.0",
|
|
@@ -15,12 +15,13 @@
|
|
|
15
15
|
"description": "Highly effective, super-configurable, well-tested web page minifier",
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@eslint/js": "^10.0.1",
|
|
18
|
-
"@swc/core": "^1.16.
|
|
18
|
+
"@swc/core": "^1.16.22",
|
|
19
19
|
"@types/node": "^26.6.6",
|
|
20
20
|
"eslint": "^10.14.0",
|
|
21
21
|
"globals": "^17.14.0",
|
|
22
|
+
"parse5": "^8.1.1",
|
|
22
23
|
"typescript": "^7.0.2",
|
|
23
|
-
"vite": "^8.3.
|
|
24
|
+
"vite": "^8.3.6"
|
|
24
25
|
},
|
|
25
26
|
"engines": {
|
|
26
27
|
"node": ">=22.13"
|
|
@@ -88,10 +89,11 @@
|
|
|
88
89
|
"prepare": "git config core.hooksPath .githooks || true",
|
|
89
90
|
"serve": "vite",
|
|
90
91
|
"test": "npm run test:types && node --test \"test/**/*.test.js\" \"backtest/*.test.js\"",
|
|
92
|
+
"test:equivalence": "node test/equivalence/corpus.js",
|
|
91
93
|
"test:types": "tsc --noEmit && tsc --project tsconfig.test.json",
|
|
92
94
|
"test:watch": "node --test --watch \"test/**/*.test.js\" \"backtest/*.test.js\""
|
|
93
95
|
},
|
|
94
96
|
"type": "module",
|
|
95
97
|
"types": "dist/types/htmlminifier.d.ts",
|
|
96
|
-
"version": "5.0.
|
|
98
|
+
"version": "5.0.3"
|
|
97
99
|
}
|