Merge pull request #76 from mearashadowfax/update-minifier

Replace 'html-minifier' with 'html-minifier-terser'
This commit is contained in:
Emil Gulamov 2024-05-06 19:24:19 +00:00 committed by GitHub
commit 6db59a500f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

2
package-lock.json generated
View file

@ -9342,4 +9342,4 @@
} }
} }
} }
} }

View file

@ -20,7 +20,7 @@
"astro-compressor": "^0.4.1", "astro-compressor": "^0.4.1",
"globby": "^14.0.1", "globby": "^14.0.1",
"gsap": "^3.12.5", "gsap": "^3.12.5",
"html-minifier": "^4.0.0", "html-minifier-terser": "^7.2.0",
"preline": "^2.1.0", "preline": "^2.1.0",
"sharp": "^0.33.3", "sharp": "^0.33.3",
"sharp-ico": "^0.1.5", "sharp-ico": "^0.1.5",

View file

@ -1,6 +1,6 @@
import fs from 'node:fs/promises' import fs from 'node:fs/promises'
import { globby } from 'globby' import { globby } from 'globby'
import { minify } from 'html-minifier' import { minify } from 'html-minifier-terser'
// Get all HTML files from the output directory // Get all HTML files from the output directory
const path = './.vercel/output/static' const path = './.vercel/output/static'
@ -12,7 +12,7 @@ await Promise.all(
let html = await fs.readFile(file, 'utf-8') let html = await fs.readFile(file, 'utf-8')
// Minify the HTML // Minify the HTML
html = minify(html, { html = await minify(html, {
removeComments: true, removeComments: true,
preserveLineBreaks: true, preserveLineBreaks: true,
collapseWhitespace: true, collapseWhitespace: true,