html-bundle 6.0.12 → 6.0.13
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/bundle.mjs +5 -0
- package/package.json +1 -1
- package/src/bundle.mts +5 -0
package/dist/bundle.mjs
CHANGED
|
@@ -315,7 +315,12 @@ async function minifyHTML(file, buildFile) {
|
|
|
315
315
|
}
|
|
316
316
|
if (isCritical) {
|
|
317
317
|
try {
|
|
318
|
+
const isPartical = !fileText.startsWith("<!DOCTYPE html>");
|
|
318
319
|
fileText = await critters.process(fileText);
|
|
320
|
+
// fix critters jsdom
|
|
321
|
+
if (isPartical) {
|
|
322
|
+
fileText = fileText.replace(/<\/?(html|head|body)>/g, "");
|
|
323
|
+
}
|
|
319
324
|
}
|
|
320
325
|
catch (err) {
|
|
321
326
|
console.error(err);
|
package/package.json
CHANGED
package/src/bundle.mts
CHANGED
|
@@ -373,7 +373,12 @@ async function minifyHTML(file: string, buildFile: string) {
|
|
|
373
373
|
|
|
374
374
|
if (isCritical) {
|
|
375
375
|
try {
|
|
376
|
+
const isPartical = !fileText.startsWith("<!DOCTYPE html>");
|
|
376
377
|
fileText = await critters.process(fileText);
|
|
378
|
+
// fix critters jsdom
|
|
379
|
+
if (isPartical) {
|
|
380
|
+
fileText = fileText.replace(/<\/?(html|head|body)>/g, "");
|
|
381
|
+
}
|
|
377
382
|
} catch (err) {
|
|
378
383
|
console.error(err);
|
|
379
384
|
}
|