html-minifier-next 5.1.4 → 5.1.5
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/dist/htmlminifier.cjs
CHANGED
|
@@ -1738,19 +1738,21 @@ const processOptions = (inputOptions, { getLightningCSS, getTerser, getSwc, getS
|
|
|
1738
1738
|
});
|
|
1739
1739
|
};
|
|
1740
1740
|
|
|
1741
|
-
//
|
|
1741
|
+
// Merge preset with user options so all values go through normalization
|
|
1742
|
+
// User options take precedence over preset values
|
|
1743
|
+
let effectiveInput = inputOptions;
|
|
1742
1744
|
if (inputOptions.preset) {
|
|
1743
1745
|
const preset = getPreset(inputOptions.preset);
|
|
1744
1746
|
if (preset) {
|
|
1745
|
-
|
|
1747
|
+
effectiveInput = { ...preset, ...inputOptions };
|
|
1746
1748
|
} else {
|
|
1747
1749
|
const available = getPresetNames().join(', ');
|
|
1748
1750
|
console.warn(`HTML Minifier Next: Unknown preset “${inputOptions.preset}”. Available presets: ${available}`);
|
|
1749
1751
|
}
|
|
1750
1752
|
}
|
|
1751
1753
|
|
|
1752
|
-
Object.keys(
|
|
1753
|
-
const option =
|
|
1754
|
+
Object.keys(effectiveInput).forEach(function (key) {
|
|
1755
|
+
const option = effectiveInput[key];
|
|
1754
1756
|
|
|
1755
1757
|
// Skip preset key—it’s already been processed
|
|
1756
1758
|
if (key === 'preset') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/lib/options.js"],"names":[],"mappings":"AAYA,6DAUC;AAID;;;;;;;;;;;GAWG;AACH,6CAXW,OAAO,CAAC,eAAe,CAAC,mGAEhC;IAAuB,eAAe;IACf,SAAS;IACT,MAAM;CAA2B,GAK9C,eAAe,
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/lib/options.js"],"names":[],"mappings":"AAYA,6DAUC;AAID;;;;;;;;;;;GAWG;AACH,6CAXW,OAAO,CAAC,eAAe,CAAC,mGAEhC;IAAuB,eAAe;IACf,SAAS;IACT,MAAM;CAA2B,GAK9C,eAAe,CA+W3B"}
|
package/package.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
21
21
|
"@swc/core": "^1.15.11",
|
|
22
22
|
"eslint": "^10.0.0",
|
|
23
|
-
"rollup": "^4.
|
|
23
|
+
"rollup": "^4.59.0",
|
|
24
24
|
"rollup-plugin-polyfill-node": "^0.13.0",
|
|
25
25
|
"typescript": "^5.9.3",
|
|
26
26
|
"vite": "^7.3.1"
|
|
@@ -95,5 +95,5 @@
|
|
|
95
95
|
},
|
|
96
96
|
"type": "module",
|
|
97
97
|
"types": "./dist/types/htmlminifier.d.ts",
|
|
98
|
-
"version": "5.1.
|
|
98
|
+
"version": "5.1.5"
|
|
99
99
|
}
|
package/src/lib/options.js
CHANGED
|
@@ -66,19 +66,21 @@ const processOptions = (inputOptions, { getLightningCSS, getTerser, getSwc, getS
|
|
|
66
66
|
});
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
//
|
|
69
|
+
// Merge preset with user options so all values go through normalization
|
|
70
|
+
// User options take precedence over preset values
|
|
71
|
+
let effectiveInput = inputOptions;
|
|
70
72
|
if (inputOptions.preset) {
|
|
71
73
|
const preset = getPreset(inputOptions.preset);
|
|
72
74
|
if (preset) {
|
|
73
|
-
|
|
75
|
+
effectiveInput = { ...preset, ...inputOptions };
|
|
74
76
|
} else {
|
|
75
77
|
const available = getPresetNames().join(', ');
|
|
76
78
|
console.warn(`HTML Minifier Next: Unknown preset “${inputOptions.preset}”. Available presets: ${available}`);
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
81
|
|
|
80
|
-
Object.keys(
|
|
81
|
-
const option =
|
|
82
|
+
Object.keys(effectiveInput).forEach(function (key) {
|
|
83
|
+
const option = effectiveInput[key];
|
|
82
84
|
|
|
83
85
|
// Skip preset key—it’s already been processed
|
|
84
86
|
if (key === 'preset') {
|