html-minifier-next 6.2.11 → 7.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/README.md CHANGED
@@ -4,10 +4,12 @@
4
4
 
5
5
  Your web page optimization precision tool: HTML Minifier Next (HMN) is a **super-configurable, well-tested, JavaScript-based HTML minifier** able to also handle in-document CSS, JavaScript, and SVG minification.
6
6
 
7
- The project was based on [HTML Minifier Terser (HMT)](https://github.com/terser/html-minifier-terser), which in turn had been based on [Juriy “kangax” Zaytsev’s HTML Minifier (HM)](https://github.com/kangax/html-minifier). It is now **the official successor to HTML Minifier**. HMN is maintained, easier to use, offers new features, and has been optimized for speed.
7
+ The project was based on [HTML Minifier Terser (HMT)](https://github.com/terser/html-minifier-terser), which in turn had been based on [Juriy “kangax” Zaytsev’s HTML Minifier (HM)](https://github.com/kangax/html-minifier). HMN is **the official successor to HTML Minifier**: It’s maintained, easier to use, offers new features, and has been optimized for speed. Note that HMN is largely compatible with HM and HMT but has evolved—find [migration guidance in the changelog](https://github.com/j9t/html-minifier-next/blob/main/CHANGELOG.md).
8
8
 
9
9
  ## Installation
10
10
 
11
+ HTML Minifier Next is ESM-only and requires Node.js ≥22.
12
+
11
13
  For use as a command-line app, use npx:
12
14
 
13
15
  ```shell
@@ -44,7 +46,7 @@ Use `npx html-minifier-next --help` to check all available options:
44
46
 
45
47
  ### Configuration file
46
48
 
47
- You can use a configuration file to specify options. The file can be either JSON format or a JavaScript module that exports the configuration object:
49
+ You can use a configuration file to specify options. The file can be either in JSON format or a JavaScript module that exports the configuration object:
48
50
 
49
51
  **JSON configuration example:**
50
52
 
@@ -57,10 +59,10 @@ You can use a configuration file to specify options. The file can be either JSON
57
59
  }
58
60
  ```
59
61
 
60
- **JavaScript module configuration example:**
62
+ **JavaScript module configuration example** (requires `"type": "module"` in the project’s package.json, or use a .mjs extension):
61
63
 
62
64
  ```javascript
63
- module.exports = {
65
+ export default {
64
66
  collapseWhitespace: true,
65
67
  removeComments: true,
66
68
  fileExt: "html,php",
@@ -70,8 +72,6 @@ module.exports = {
70
72
 
71
73
  ### Node.js
72
74
 
73
- ESM with Node.js ≥16.14:
74
-
75
75
  ```javascript
76
76
  import { minify } from 'html-minifier-next';
77
77
 
@@ -82,17 +82,6 @@ const result = await minify('<p title="example" id="moo">foo</p>', {
82
82
  console.log(result); // “<p title=example id=moo>foo”
83
83
  ```
84
84
 
85
- CommonJS:
86
-
87
- ```javascript
88
- const { minify } = require('html-minifier-next');
89
-
90
- (async () => {
91
- const result = await minify('<p title="example" id="moo">foo</p>', { preset: 'comprehensive' });
92
- console.log(result); // “<p id=moo title=example>foo”
93
- })();
94
- ```
95
-
96
85
  See [the original blog post](https://perfectionkills.com/experimenting-with-html-minifier/) for details of [how it works](https://perfectionkills.com/experimenting-with-html-minifier/#how_it_works), [descriptions of most options](https://perfectionkills.com/experimenting-with-html-minifier/#options), [testing results](https://perfectionkills.com/experimenting-with-html-minifier/#field_testing), and [conclusions](https://perfectionkills.com/experimenting-with-html-minifier/#cost_and_benefits).
97
86
 
98
87
  ## Presets
@@ -165,19 +154,28 @@ Options can be used in config files (camelCase) or via CLI flags (kebab-case wit
165
154
  | `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) |
166
155
  | `removeAttributeQuotes`<br>`--remove-attribute-quotes` | [Remove quotes around attributes when possible](https://perfectionkills.com/experimenting-with-html-minifier/#remove_attribute_quotes) | `false` |
167
156
  | `removeComments`<br>`--remove-comments` | [Strip HTML comments](https://perfectionkills.com/experimenting-with-html-minifier/#remove_comments) | `false` |
157
+ | `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` |
168
158
  | `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)`) |
169
159
  | `removeEmptyElements`<br>`--remove-empty-elements` | [Remove all elements with empty contents](https://perfectionkills.com/experimenting-with-html-minifier/#remove_empty_elements) | `false` |
170
160
  | `removeEmptyElementsExcept`<br>`--remove-empty-elements-except` | Array of elements to preserve when `removeEmptyElements` is enabled; accepts simple tag names (e.g., `["td"]`) or HTML-like markup with attributes (e.g., `["<span aria-hidden='true'>"]`); supports double quotes, single quotes, and unquoted attribute values | `[]` |
171
161
  | `removeOptionalTags`<br>`--remove-optional-tags` | [Remove optional tags](https://perfectionkills.com/experimenting-with-html-minifier/#remove_optional_tags) | `false` |
172
162
  | `removeRedundantAttributes`<br>`--remove-redundant-attributes` | [Remove attributes when value matches default](https://meiert.com/blog/optional-html/#toc-attribute-values) | `false` |
173
- | `removeScriptTypeAttributes`<br>`--remove-script-type-attributes` | Remove `type="text/javascript"` from `script` elements; other `type` attribute values are left intact | `false` |
174
- | `removeStyleLinkTypeAttributes`<br>`--remove-style-link-type-attributes` | Remove `type="text/css"` from `style` and `link` elements; other `type` attribute values are left intact | `false` |
175
163
  | `removeTagWhitespace`<br>`--remove-tag-whitespace` | Remove space between attributes whenever possible; **note that this will result in invalid HTML** | `false` |
176
164
  | `sortAttributes`<br>`--sort-attributes` | [Sort attributes by frequency](#sorting-attributes-and-style-classes) | `false` |
177
165
  | `sortClassNames`<br>`--sort-class-names` | [Sort style classes by frequency](#sorting-attributes-and-style-classes) | `false` |
178
166
  | `trimCustomFragments`<br>`--trim-custom-fragments` | Trim whitespace around custom fragments (`ignoreCustomFragments`) | `false` |
179
167
  | `useShortDoctype`<br>`--use-short-doctype` | [Replaces the doctype with the short HTML doctype](https://perfectionkills.com/experimenting-with-html-minifier/#use_short_doctype) | `false` |
180
168
 
169
+ ### API-only options
170
+
171
+ A few options take functions and are therefore only available programmatically, not via CLI flags or config files:
172
+
173
+ | Option | Description | Default |
174
+ | --- | --- | --- |
175
+ | `canCollapseWhitespace` | `Function(tag, attrs, defaultFn)` that determines whether whitespace inside an element can be collapsed—override to protect additional elements, delegating to `defaultFn` for the rest | Built-in handling (protects `pre`, `textarea`, etc.) |
176
+ | `canTrimWhitespace` | `Function(tag, attrs, defaultFn)` that determines whether leading and trailing whitespace around an element may be trimmed | Built-in handling |
177
+ | `log` | `Function(message)` called with warnings and errors, including minification errors swallowed by `continueOnMinifyError` (e.g., pass `console.error` to surface them) | No-op (errors are silent) |
178
+
181
179
  ### Sorting attributes and style classes
182
180
 
183
181
  Minifier options like `sortAttributes` and `sortClassNames` won’t impact the plain-text size of the output. However, using these options for more consistent ordering improves the compression ratio for Gzip and Brotli used over HTTP.
@@ -374,7 +372,7 @@ The caches persist across multiple `minify()` calls, making them particularly ef
374
372
 
375
373
  ## Minification comparison
376
374
 
377
- Please see [**the Minifier Benchmarks project**](https://github.com/j9t/minifier-benchmarks) for details on how HMN compares to other minifiers.
375
+ Please see [**the Minifier Benchmarks project**](https://github.com/j9t/minifier-benchmarks) for details on how HTML Minifier Next compares to other minifiers.
378
376
 
379
377
  ## Examples
380
378
 
@@ -622,7 +620,7 @@ To profile the current working tree, run the benchmark with Node’s built-in CP
622
620
  node --cpu-prof benchmark.js
623
621
  ```
624
622
 
625
- This writes a `.cpuprofile` file to the working directory. Load it with `npx speedscope *.cpuprofile` for a flamegraph, or drag it into Chrome DevTools → Sources → JavaScript Profiler. Compare self-time per function against a clean baseline run on `main`. Pay attention to unexpectedly heavy callbacks in hot paths—V8 de-optimization from variable object shapes or unnecessary method calls can show up there.
623
+ This writes a .cpuprofile file to the working directory. Load it with `npx speedscope *.cpuprofile` for a flamegraph, or drag it into Chrome DevTools → Sources → JavaScript Profiler. Compare self-time per function against a clean baseline run on `main`. Pay attention to unexpectedly heavy callbacks in hot paths—V8 de-optimization from variable object shapes or unnecessary method calls can show up there.
626
624
 
627
625
  ## Acknowledgements
628
626
 
package/cli.js CHANGED
@@ -33,7 +33,6 @@ import path from 'path';
33
33
  import { pathToFileURL } from 'url';
34
34
  import os from 'os';
35
35
  import readline from 'readline';
36
- import { createRequire } from 'module';
37
36
  import { Command, Option } from 'commander';
38
37
 
39
38
  // Simple case conversion for CLI option names (ASCII-only, no Unicode needed)
@@ -55,8 +54,7 @@ import { getPreset, getPresetNames } from './src/presets.js';
55
54
  import { parseRegExp } from './src/lib/utils.js';
56
55
  import { optionDefinitions } from './src/lib/option-definitions.js';
57
56
 
58
- const require = createRequire(import.meta.url);
59
- const pkg = require('./package.json');
57
+ const pkg = JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url), 'utf8'));
60
58
 
61
59
  const EXTENSIONS_DEFAULT = ['html', 'htm', 'shtml', 'shtm'];
62
60
  const EXTENSIONS_NON_HTML = new Set(['css', 'js', 'mjs', 'cjs', 'jsx', 'ts', 'tsx', 'svg']);
@@ -196,9 +194,8 @@ function readFile(file) {
196
194
  }
197
195
 
198
196
  /**
199
- * Load config from a file path—for unambiguous extensions (.json, .cjs, .mjs) only the
200
- * matching format is attempted and its error shown on failure; for .js or unknown extensions
201
- * all formats are tried and the most relevant error is reported
197
+ * Load config from a file path. Extensions .json, .js, and .mjs are handled
198
+ * directly; for unknown extensions, JSON is tried first, then module import.
202
199
  * @param {string} configPath - Path to config file
203
200
  * @returns {Promise<object>} Loaded config object
204
201
  */
@@ -211,37 +208,27 @@ async function loadConfigFromPath(configPath) {
211
208
  catch (err) { fatal(`Cannot parse config file as JSON: ${err.message}`); }
212
209
  }
213
210
 
214
- if (ext === '.cjs') {
215
- try {
216
- const result = require(abs);
217
- return (result && typeof result === 'object' && result.__esModule === true) ? result.default : result;
218
- } catch (err) { fatal(`Cannot load config file: ${err.message}`); }
219
- }
220
-
221
- if (ext === '.mjs') {
211
+ if (ext === '.js' || ext === '.mjs') {
212
+ // `import()` handles both ESM and CJS .js files—Node resolves the type via the
213
+ // nearest package.json `type` field, same as it does for regular module loading
222
214
  try { const mod = await import(pathToFileURL(abs).href); return 'default' in mod ? mod.default : mod; }
223
215
  catch (err) { fatal(`Cannot load config file: ${err.message}`); }
224
216
  }
225
217
 
226
- // For .js or extension-less files, try JSON first, then CJS, then ESM
218
+ // Unknown extension: Try JSON, then module import
227
219
  let jsonErr;
228
220
  try { return JSON.parse(readFile(abs).replace(/^\uFEFF/, '')); }
229
221
  catch (err) { jsonErr = err; }
230
222
 
231
- try {
232
- const result = require(abs);
233
- // Handle ESM interop: If `require()` loads an ESM file, it may return `{__esModule: true, default: }`
234
- return (result && typeof result === 'object' && result.__esModule === true) ? result.default : result;
235
- } catch (cjsErr) {
236
- try { const mod = await import(pathToFileURL(abs).href); return 'default' in mod ? mod.default : mod; }
237
- catch (esmErr) {
238
- fatal(ext === '.js'
239
- ? `Cannot load config file: ${cjsErr.message}\nAs module: ${esmErr.message}`
240
- : `Cannot read the specified config file.\nAs JSON: ${jsonErr.message}\nAs CJS: ${cjsErr.message}\nAs module: ${esmErr.message}`);
241
- }
223
+ try { const mod = await import(pathToFileURL(abs).href); return 'default' in mod ? mod.default : mod; }
224
+ catch (esmErr) {
225
+ fatal(`Cannot read the specified config file.\nAs JSON: ${jsonErr.message}\nAs module: ${esmErr.message}`);
242
226
  }
243
227
  }
244
228
 
229
+ // Config keys the CLI handles itself, beyond the options in `optionDefinitions`
230
+ const CONFIG_KEYS_EXTRA = new Set(['preset', 'fileExt', 'ignoreDir']);
231
+
245
232
  /**
246
233
  * Normalize and validate config object by applying parsers and transforming values.
247
234
  * @param {object} config - Raw config object
@@ -250,6 +237,13 @@ async function loadConfigFromPath(configPath) {
250
237
  function normalizeConfig(config) {
251
238
  const normalized = { ...config };
252
239
 
240
+ // Warn about unrecognized config keys—catches typos as well as options removed in earlier versions
241
+ Object.keys(normalized).forEach(function (key) {
242
+ if (!Object.hasOwn(optionDefinitions, key) && !CONFIG_KEYS_EXTRA.has(key)) {
243
+ console.error(`Ignoring unknown or deprecated config option “${key}” (see \`--help\` or README for available options)`);
244
+ }
245
+ });
246
+
253
247
  // Apply parsers to main options
254
248
  mainOptionKeys.forEach(function (key) {
255
249
  if (key in normalized) {
@@ -844,7 +838,7 @@ program.helpOption('-h, --help', 'Display help for command');
844
838
  }
845
839
  })();
846
840
  } else if (filesProvided) { // Minifying one or more files specified on the CMD line
847
- // Process each file independently, then concatenate outputs to preserve current behavior
841
+ // Process each file independently, then concatenate outputs
848
842
  const minifierOptions = createOptions();
849
843
  // Show config info if verbose/dry
850
844
  if (programOptions.verbose || programOptions.dry) {
@@ -133,7 +133,7 @@ export type MinifierOptions = {
133
133
  continueOnParseError?: boolean;
134
134
  /**
135
135
  * Array of regexes used to recognise custom attribute assignment
136
- * operators (e.g. `'<div flex?="{{mode != cover}}"></div>'`).
136
+ * operators (e.g., `'<div flex?="{{mode != cover}}"></div>'`).
137
137
  * These are concatenated with the built-in assignment patterns.
138
138
  *
139
139
  * Default: `[]`
@@ -142,18 +142,18 @@ export type MinifierOptions = {
142
142
  /**
143
143
  * Regex matching attribute names whose values should be collapsed.
144
144
  * Basically used to remove newlines and excess spaces inside attribute values,
145
- * e.g. `/ng-class/`.
145
+ * e.g., `/ng-class/`.
146
146
  */
147
147
  customAttrCollapse?: RegExp;
148
148
  /**
149
149
  * Array of `[openRegExp, closeRegExp]` pairs used by the parser to
150
150
  * detect custom attribute surround patterns (for non-standard syntaxes,
151
- * e.g. `<input {{#if value}}checked="checked"{{/if}}>`).
151
+ * e.g., `<input {{#if value}}checked="checked"{{/if}}>`).
152
152
  */
153
153
  customAttrSurround?: [RegExp, RegExp][];
154
154
  /**
155
155
  * Array of regexes used to detect event handler attributes for `minifyJS`
156
- * (e.g. `ng-click`). The default matches standard `on…` event attributes.
156
+ * (e.g., `ng-click`). The default matches standard `on…` event attributes.
157
157
  *
158
158
  * Default: `[/^on[a-z]{3,}$/]`
159
159
  */
@@ -288,14 +288,6 @@ export type MinifierOptions = {
288
288
  * Default: `false`
289
289
  */
290
290
  minifySVG?: boolean | Object;
291
- /**
292
- * Function used to normalise tag/attribute names. By default, this lowercases
293
- * names, unless `caseSensitive` is enabled.
294
- *
295
- * Default: `(name) => name.toLowerCase()`,
296
- * or `(name) => name` (no-op function) if `caseSensitive` is enabled.
297
- */
298
- name?: (name: string) => string;
299
291
  /**
300
292
  * When wrapping lines, prevent inserting a newline directly before a
301
293
  * closing tag (useful to keep tags like `</a>` on the same line).
@@ -321,6 +313,14 @@ export type MinifierOptions = {
321
313
  * Default: `false`
322
314
  */
323
315
  preserveLineBreaks?: boolean;
316
+ /**
317
+ * Name of a preset configuration to use as a base (`conservative` or
318
+ * `comprehensive`). Explicitly provided options take precedence over
319
+ * preset values. Unknown preset names are ignored (with a warning).
320
+ *
321
+ * Default: No preset
322
+ */
323
+ preset?: string;
324
324
  /**
325
325
  * When true, attribute values will not be HTML-escaped (dangerous for
326
326
  * untrusted input). By default, attributes are escaped.
@@ -331,7 +331,7 @@ export type MinifierOptions = {
331
331
  /**
332
332
  * Array of `type` attribute values for `<script>` elements whose contents
333
333
  * should be processed as HTML
334
- * (e.g. `text/ng-template`, `text/x-handlebars-template`, etc.).
334
+ * (e.g., `text/ng-template`, `text/x-handlebars-template`, etc.).
335
335
  * When present, the contents of matching script tags are recursively minified,
336
336
  * like normal HTML content.
337
337
  *
@@ -360,6 +360,13 @@ export type MinifierOptions = {
360
360
  * Default: `false`
361
361
  */
362
362
  removeComments?: boolean;
363
+ /**
364
+ * Remove default `type` attributes from `<style>`/`<link>` (e.g., `type="text/css"`)
365
+ * and `<script>` (e.g., `type="text/javascript"`) elements.
366
+ *
367
+ * Default: `false`
368
+ */
369
+ removeDefaultTypeAttributes?: boolean;
363
370
  /**
364
371
  * If true, removes attributes whose values are empty (some attributes
365
372
  * are excluded by name). Can also be a function to customise which empty
@@ -419,20 +426,6 @@ export type MinifierOptions = {
419
426
  * Default: `false`
420
427
  */
421
428
  removeRedundantAttributes?: boolean;
422
- /**
423
- * Remove `type` attributes from `<script>` when they are unnecessary
424
- * (e.g. `type="text/javascript"`).
425
- *
426
- * Default: `false`
427
- */
428
- removeScriptTypeAttributes?: boolean;
429
- /**
430
- * Remove `type` attributes from `<style>` and `<link>` elements when
431
- * they are unnecessary (e.g. `type="text/css"`).
432
- *
433
- * Default: `false`
434
- */
435
- removeStyleLinkTypeAttributes?: boolean;
436
429
  /**
437
430
  * **Note that this will result in invalid HTML!**
438
431
  *
@@ -476,22 +469,6 @@ export type MinifierOptions = {
476
469
  * Default: `false`
477
470
  */
478
471
  useShortDoctype?: boolean;
479
- /**
480
- * - Internal: Set when inside SVG/MathML context
481
- */
482
- insideSVG?: boolean;
483
- /**
484
- * - Internal: Set when inside SVG `foreignObject`
485
- */
486
- insideForeignContent?: boolean;
487
- /**
488
- * - Internal: Preserved name function during namespace transitions
489
- */
490
- parentName?: Function;
491
- /**
492
- * - Internal: HTML name function preserved from outer context
493
- */
494
- htmlName?: Function;
495
472
  };
496
473
  import { presets } from './presets.js';
497
474
  import { getPreset } from './presets.js';
@@ -1 +1 @@
1
- {"version":3,"file":"htmlminifier.d.ts","sourceRoot":"","sources":["../../src/htmlminifier.js"],"names":[],"mappings":"AA62DO,8BAJI,MAAM,YACN,eAAe,GACb,OAAO,CAAC,MAAM,CAAC,CA0B3B;;;;;;;;;;;;;UAt0DS,MAAM;YACN,MAAM;YACN,MAAM;mBACN,MAAM;iBACN,MAAM;kBACN,MAAM;;;;;;;;;;;;;4BAQN,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,qBAAqB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,KAAK,OAAO;;;;;;;wBAMjG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,SAAS,EAAE,iBAAiB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,KAAK,OAAO;;;;;;;;;;eAMhH,MAAM;;;;;;;;;;cASN,MAAM;;;;;;;;;;eASN,MAAM;;;;;;;;oBASN,OAAO;;;;;;;;;kCAON,OAA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AC,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;;;;;;;;;;iBAa3J,OAAO,GAAG,MAAM,GAAG;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;;;;;;;;;gBASjF,OAAO,GAAG,MAAM;;;;;;;+BAQhB,OAAO;;;;;;;;;;oBAMP,OAAO;;;;;;;;yBASP,OAAO;;;;;;;;aAOP,MAAM;;;;;;;gCAON,OAAO;;;;;;;;;;qBAMP,MAAM,EAAE;;;;;;;qBASR,IAAI,GAAG,GAAG;;;;;;;4BAMV,OAAO;;;;;;;;qBAMP,OAAO;;;;;;;kCAON,OAAO;;;;;;;;;4BAMR,OAAO,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;;;;;;;;0BAQtD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;gCAOP,MAAM,EAAE;;;;;;;;yBAyBR,OAAO;;;;;;;;gCAOP,OAAO;;;;;;;;;;0BAOP,OAAO;;;;;;;;;qBASP,OAAO,GAAG,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,IAAI,CAAC;;;;;;;;;qBAQzD,OAAO,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;;;;;;;;0BAQrC,OAAO;;;;;;;sBAOP,OAAO;;wBA5ckC,cAAc;0BAAd,cAAc;+BAAd,cAAc"}
@@ -11,11 +11,9 @@ export type HTMLAttribute = {
11
11
  };
12
12
  /**
13
13
  * @param {string} text
14
- * @param {{ignoreCustomComments: RegExp[]}} options
14
+ * @param {ProcessedOptions} options
15
15
  */
16
- export function isIgnoredComment(text: string, options: {
17
- ignoreCustomComments: RegExp[];
18
- }): boolean;
16
+ export function isIgnoredComment(text: string, options: ProcessedOptions): boolean;
19
17
  /**
20
18
  * @param {string} attrName
21
19
  * @param {{customEventAttributes?: RegExp[]}} options
@@ -110,31 +108,39 @@ export function hasAttrName(name: string, attrs: HTMLAttribute[]): boolean;
110
108
  * @param {string} tag
111
109
  * @param {string} attrName
112
110
  * @param {string} attrValue
113
- * @param {Record<string, any>} options
111
+ * @param {ProcessedOptions} options
114
112
  * @param {HTMLAttribute[]} attrs
115
113
  * @param {Function} minifyHTMLSelf
116
114
  */
117
- export function cleanAttributeValue(tag: string, attrName: string, attrValue: string, options: Record<string, any>, attrs: HTMLAttribute[], minifyHTMLSelf: Function): any;
115
+ export function cleanAttributeValue(tag: string, attrName: string, attrValue: string, options: ProcessedOptions, attrs: HTMLAttribute[], minifyHTMLSelf: Function): any;
118
116
  /**
119
117
  * @param {HTMLAttribute} attr
120
118
  * @param {HTMLAttribute[]} attrs
121
119
  * @param {string} tag
122
- * @param {Record<string, any>} options
120
+ * @param {ProcessedOptions} options
123
121
  * @param {Function} minifyHTML
124
122
  */
125
- export function normalizeAttr(attr: HTMLAttribute, attrs: HTMLAttribute[], tag: string, options: Record<string, any>, minifyHTML: Function): any;
123
+ export function normalizeAttr(attr: HTMLAttribute, attrs: HTMLAttribute[], tag: string, options: ProcessedOptions, minifyHTML: Function): {
124
+ attr: HTMLAttribute;
125
+ name: string;
126
+ value: string | undefined;
127
+ } | PromiseLike<{
128
+ attr: HTMLAttribute;
129
+ name: string;
130
+ value: string | undefined;
131
+ } | undefined> | undefined;
126
132
  /**
127
- * @param {{name: string, value?: string, attr: HTMLAttribute}} normalized
133
+ * @param {{name: string, value: string | undefined, attr: HTMLAttribute}} normalized
128
134
  * @param {string | boolean | undefined} hasUnarySlash
129
- * @param {Record<string, any>} options
135
+ * @param {ProcessedOptions} options
130
136
  * @param {boolean} isLast
131
137
  * @param {string | undefined} uidAttr
132
138
  */
133
139
  export function buildAttr(normalized: {
134
140
  name: string;
135
- value?: string;
141
+ value: string | undefined;
136
142
  attr: HTMLAttribute;
137
- }, hasUnarySlash: string | boolean | undefined, options: Record<string, any>, isLast: boolean, uidAttr: string | undefined): string;
143
+ }, hasUnarySlash: string | boolean | undefined, options: ProcessedOptions, isLast: boolean, uidAttr: string | undefined): string;
138
144
  /**
139
145
  * Remove duplicate attributes from an attribute list.
140
146
  * Per HTML spec, when an attribute appears multiple times, the first occurrence wins.
@@ -144,4 +150,5 @@ export function buildAttr(normalized: {
144
150
  * @returns {HTMLAttribute[]} Deduplicated attribute array (modifies in place and returns)
145
151
  */
146
152
  export function deduplicateAttributes(attrs: HTMLAttribute[], caseSensitive: boolean): HTMLAttribute[];
153
+ import type { ProcessedOptions } from './options.js';
147
154
  //# sourceMappingURL=attributes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../src/lib/attributes.js"],"names":[],"mappings":";;;4BAwBa;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;AAiB3I;;;GAGG;AACH,uCAHW,MAAM,WACN;IAAC,oBAAoB,EAAE,MAAM,EAAE,CAAA;CAAC,WAW1C;AAED;;;GAGG;AACH,2CAHW,MAAM,WACN;IAAC,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAA;CAAC,WAa5C;AAED,4BAA4B;AAC5B,gDADY,MAAM,WAIjB;AAED;;;GAGG;AACH,8CAHW,aAAa,EAAE,aACf,MAAM,WAShB;AA+BD;;;;;GAKG;AACH,0CALW,MAAM,YACN,MAAM,aACN,MAAM,SACN,aAAa,EAAE,WAyCzB;AAED,mEAGC;AAED,qEAGC;AAED;;;GAGG;AACH,wCAHW,M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D;;;;;;;GAOG;AACH,6CAJW,aAAa,EAAE,iBACf,OAAO,GACL,aAAa,EAAE,CAqB3B"}
1
+ {"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../src/lib/attributes.js"],"names":[],"mappings":";;;4BA0Ba;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;AAiB3I;;;GAGG;AACH,uCAHW,MAAM,WACN,gBAAgB,WAS1B;AAED;;;GAGG;AACH,2CAHW,MAAM,WACN;IAAC,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAA;CAAC,WAa5C;AAED,4BAA4B;AAC5B,gDADY,MAAM,WAIjB;AAED;;;GAGG;AACH,8CAHW,aAAa,EAAE,aACf,MAAM,WAShB;AA+BD;;;;;GAKG;AACH,0CALW,MAAM,YACN,MAAM,aACN,MAAM,SACN,aAAa,EAAE,WAyCzB;AAED,mEAGC;AAED,qEAGC;AAED;;;GAGG;AACH,wCAHW,MAAM,SACN,aAAa,EAAE,WAYzB;AAED,sEAGC;AAED;;;GAGG;AACH,oCAHW,MAAM,SACN,aAAa,EAAE,WAYzB;AAED;;;GAGG;AACH,6CAHW,MAAM,aACN,MAAM,uBAMhB;AAmBD;;;GAGG;AACH,6CAHW,MAAM,OACN,MAAM,WAKhB;AAgBD;;;GAGG;AACH,gDAHW,MAAM,OACN,MAAM,WAKhB;AAED;;;;GAIG;AACH,gCAJW,MAAM,SACN,aAAa,EAAE,SACf,MAAM,WAYhB;AAED;;;;GAIG;AACH,kCAJW,MAAM,SACN,aAAa,EAAE,YACf,MAAM,WAIhB;AAED;;;GAGG;AACH,mCAHW,MAAM,OACN,MAAM,WAIhB;AAED;;;GAGG;AACH,oCAHW,MAAM,SACN,aAAa,EAAE,WAYzB;AAED;;;GAGG;AACH,6CAHW,MAAM,SACN,aAAa,EAAE,WAYzB;AAED;;;;;GAKG;AACH,6CALW,MAAM,YACN,MAAM,aACN,MAAM,GAAG,SAAS,WAClB;IAAC,qBAAqB,CAAC,EAAE,OAAO,WAAW,CAAA;CAAC,OAWtD;AAED;;;GAGG;AACH,kCAHW,MAAM,SACN,aAAa,EAAE,WASzB;AAUD;;;;;;;GAOG;AACH,yCAPW,MAAM,YACN,MAAM,aACN,MAAM,WACN,gBAAgB,SAChB,aAAa,EAAE,iCAkMzB;AAwBD;;;;;;GAMG;AACH,oCANW,aAAa,SACb,aAAa,EAAE,OACf,MAAM,WACN,gBAAgB;;;;;;;;2BAe1B;AA0DD;;;;;;GAMG;AACH,sCANW;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,IAAI,EAAE,aAAa,CAAA;CAAC,iBAC9D,MAAM,GAAG,OAAO,GAAG,SAAS,WAC5B,gBAAgB,UAChB,OAAO,WACP,MAAM,GAAG,SAAS,UA0H5B;AAzsBD;;;;;;;GAOG;AACH,6CAJW,aAAa,EAAE,iBACf,OAAO,GACL,aAAa,EAAE,CAqB3B;sCAlGqC,cAAc"}
@@ -1,13 +1,14 @@
1
+ /** @import { ProcessedOptions } from './options.js' */
1
2
  /**
2
3
  * @param {string} text
3
- * @param {string} type
4
+ * @param {string} [type]
4
5
  */
5
- export function wrapCSS(text: string, type: string): string;
6
+ export function wrapCSS(text: string, type?: string): string;
6
7
  /**
7
8
  * @param {string} text
8
- * @param {string} type
9
+ * @param {string} [type]
9
10
  */
10
- export function unwrapCSS(text: string, type: string): string;
11
+ export function unwrapCSS(text: string, type?: string): string;
11
12
  /**
12
13
  * @param {string} text
13
14
  * @param {{continueOnMinifyError?: boolean, log?: Function}} options
@@ -23,16 +24,13 @@ export function hasJsonScriptType(attrs: Array<{
23
24
  }>): boolean;
24
25
  /**
25
26
  * @param {string} text
26
- * @param {{continueOnMinifyError?: boolean, log?: Function, processScripts?: string[]}} options
27
+ * @param {ProcessedOptions} options
27
28
  * @param {Array<{name: string, value?: string | undefined}>} currentAttrs
28
29
  * @param {Function} minifyHTML
29
30
  */
30
- export function processScript(text: string, options: {
31
- continueOnMinifyError?: boolean;
32
- log?: Function;
33
- processScripts?: string[];
34
- }, currentAttrs: Array<{
31
+ export function processScript(text: string, options: ProcessedOptions, currentAttrs: Array<{
35
32
  name: string;
36
33
  value?: string | undefined;
37
34
  }>, minifyHTML: Function): Promise<any>;
35
+ import type { ProcessedOptions } from './options.js';
38
36
  //# sourceMappingURL=content.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/lib/content.js"],"names":[],"mappings":"AASA;;;GAGG;AACH,8BAHW,MAAM,QACN,MAAM,UAWhB;AAED;;;GAGG;AACH,gCAHW,MAAM,QACN,MAAM,UAahB;AAID;;;GAGG;AACH,iCAHW,MAAM,WACN;IAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,WAAU;CAAC,UAa3D;AAED,2DAA2D;AAC3D,yCADY,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,WAWhD;AAED;;;;;GAKG;AACH,oCALW,MAAM,WACN;IAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,WAAW;IAAC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;CAAC,gBAC5E,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAC,CAAC,sCAoB3D"}
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/lib/content.js"],"names":[],"mappings":"AAKA,uDAAuD;AAMvD;;;GAGG;AACH,8BAHW,MAAM,SACN,MAAM,UAWhB;AAED;;;GAGG;AACH,gCAHW,MAAM,SACN,MAAM,UAahB;AAID;;;GAGG;AACH,iCAHW,MAAM,WACN;IAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,WAAU;CAAC,UAa3D;AAED,2DAA2D;AAC3D,yCADY,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,WAWhD;AAED;;;;;GAKG;AACH,oCALW,MAAM,WACN,gBAAgB,gBAChB,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAC,CAAC,sCAoB3D;sCA7FqC,cAAc"}
@@ -1,11 +1,5 @@
1
- export type MinifierOptions = {
2
- name: (str: string) => string;
3
- log?: Function;
4
- };
5
1
  /** @import { HTMLAttribute } from './attributes.js' */
6
- /**
7
- * @typedef {{ name: (str: string) => string, log?: Function }} MinifierOptions
8
- */
2
+ /** @import { ProcessedOptions } from './options.js' */
9
3
  /**
10
4
  * @param {string} optionalStartTag
11
5
  * @param {string} tag
@@ -28,10 +22,10 @@ export function canRemovePrecedingTag(optionalEndTag: string, tag: string): bool
28
22
  export function canRemoveElement(tag: string, attrs: HTMLAttribute[]): boolean;
29
23
  /**
30
24
  * @param {string} str - Tag name or HTML-like element spec (e.g., “td” or “<span aria-hidden='true'>”)
31
- * @param {MinifierOptions} options - Options object for name normalization
25
+ * @param {ProcessedOptions} options - Options object for name normalization
32
26
  * @returns {{tag: string, attrs: Object.<string, string|undefined>|null}|null} Parsed spec or null if invalid
33
27
  */
34
- export function parseElementSpec(str: string, options: MinifierOptions): {
28
+ export function parseElementSpec(str: string, options: ProcessedOptions): {
35
29
  tag: string;
36
30
  attrs: {
37
31
  [x: string]: string | undefined;
@@ -39,10 +33,10 @@ export function parseElementSpec(str: string, options: MinifierOptions): {
39
33
  } | null;
40
34
  /**
41
35
  * @param {string[]} input - Array of element specifications from `removeEmptyElementsExcept` option
42
- * @param {MinifierOptions} options - Options object for parsing
36
+ * @param {ProcessedOptions} options - Options object for parsing
43
37
  * @returns {Array<{tag: string, attrs: Object.<string, string|undefined>|null}>} Array of parsed element specs
44
38
  */
45
- export function parseRemoveEmptyElementsExcept(input: string[], options: MinifierOptions): Array<{
39
+ export function parseRemoveEmptyElementsExcept(input: string[], options: ProcessedOptions): Array<{
46
40
  tag: string;
47
41
  attrs: {
48
42
  [x: string]: string | undefined;
@@ -61,4 +55,5 @@ export function shouldPreserveEmptyElement(tag: string, attrs: HTMLAttribute[],
61
55
  } | null;
62
56
  }>): boolean;
63
57
  import type { HTMLAttribute } from './attributes.js';
58
+ import type { ProcessedOptions } from './options.js';
64
59
  //# sourceMappingURL=elements.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../../src/lib/elements.js"],"names":[],"mappings":"8BAkBa;IAAE,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IAAC,GAAG,CAAC,WAAU;CAAE;AAL9D,uDAAuD;AAIvD;;GAEG;AAIH;;;GAGG;AACH,qDAHW,MAAM,OACN,MAAM,WAehB;AAED;;;GAGG;AACH,oDAHW,MAAM,OACN,MAAM,WAUhB;AAED;;;GAGG;AACH,sDAHW,MAAM,OACN,MAAM,WAqChB;AAID;;;GAGG;AACH,sCAHW,MAAM,SACN,aAAa,EAAE,WAwCzB;AAED;;;;GAIG;AACH,sCAJW,MAAM,WACN,eAAe,GACb;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE;YAAQ,MAAM,GAAE,MAAM,GAAC,SAAS;KAAC,GAAC,IAAI,CAAA;CAAC,GAAC,IAAI,CAgD7E;AAED;;;;GAIG;AACH,sDAJW,MAAM,EAAE,WACR,eAAe,GACb,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE;YAAQ,MAAM,GA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 -202,78 +202,72 @@ export namespace optionDefinitions {
202
202
  let type_33: string;
203
203
  export { type_33 as type };
204
204
  }
205
- namespace removeEmptyAttributes {
205
+ namespace removeDefaultTypeAttributes {
206
206
  let description_34: string;
207
207
  export { description_34 as description };
208
208
  let type_34: string;
209
209
  export { type_34 as type };
210
210
  }
211
- namespace removeEmptyElements {
211
+ namespace removeEmptyAttributes {
212
212
  let description_35: string;
213
213
  export { description_35 as description };
214
214
  let type_35: string;
215
215
  export { type_35 as type };
216
216
  }
217
- namespace removeEmptyElementsExcept {
217
+ namespace removeEmptyElements {
218
218
  let description_36: string;
219
219
  export { description_36 as description };
220
220
  let type_36: string;
221
221
  export { type_36 as type };
222
222
  }
223
- namespace removeOptionalTags {
223
+ namespace removeEmptyElementsExcept {
224
224
  let description_37: string;
225
225
  export { description_37 as description };
226
226
  let type_37: string;
227
227
  export { type_37 as type };
228
228
  }
229
- namespace removeRedundantAttributes {
229
+ namespace removeOptionalTags {
230
230
  let description_38: string;
231
231
  export { description_38 as description };
232
232
  let type_38: string;
233
233
  export { type_38 as type };
234
234
  }
235
- namespace removeScriptTypeAttributes {
235
+ namespace removeRedundantAttributes {
236
236
  let description_39: string;
237
237
  export { description_39 as description };
238
238
  let type_39: string;
239
239
  export { type_39 as type };
240
240
  }
241
- namespace removeStyleLinkTypeAttributes {
241
+ namespace removeTagWhitespace {
242
242
  let description_40: string;
243
243
  export { description_40 as description };
244
244
  let type_40: string;
245
245
  export { type_40 as type };
246
246
  }
247
- namespace removeTagWhitespace {
247
+ namespace sortAttributes {
248
248
  let description_41: string;
249
249
  export { description_41 as description };
250
250
  let type_41: string;
251
251
  export { type_41 as type };
252
252
  }
253
- namespace sortAttributes {
253
+ namespace sortClassNames {
254
254
  let description_42: string;
255
255
  export { description_42 as description };
256
256
  let type_42: string;
257
257
  export { type_42 as type };
258
258
  }
259
- namespace sortClassNames {
259
+ namespace trimCustomFragments {
260
260
  let description_43: string;
261
261
  export { description_43 as description };
262
262
  let type_43: string;
263
263
  export { type_43 as type };
264
264
  }
265
- namespace trimCustomFragments {
265
+ namespace useShortDoctype {
266
266
  let description_44: string;
267
267
  export { description_44 as description };
268
268
  let type_44: string;
269
269
  export { type_44 as type };
270
270
  }
271
- namespace useShortDoctype {
272
- let description_45: string;
273
- export { description_45 as description };
274
- let type_45: string;
275
- export { type_45 as type };
276
- }
277
271
  }
278
272
  export namespace optionDefaults {
279
273
  let continueOnMinifyError_1: boolean;