achat-maison-albi-fr/process-html.mjs
Emil Gulamov 2d2bada884 Replace div tags with section tags in various components
The div HTML tags in various components of the project have been replaced with more appropriate section tags for better semantic structure. This affects the TestimonialsSection, Products, FeaturesStats, and several other components. Options for minifying JavaScript in the process-html file have also been updated. In the MainLayout, a main tag has been added to wrap page content for better accessibility and semantics.
2024-02-19 09:36:37 +04:00

23 lines
No EOL
599 B
JavaScript

import fs from 'node:fs/promises'
import { globby } from 'globby'
import { minify } from 'html-minifier'
// Get all HTML files from the output directory
const path = './.vercel/output/static'
const files = await globby(`${path}/**/*.html`)
await Promise.all(
files.map(async (file) => {
console.log('Processing file:', file)
let html = await fs.readFile(file, 'utf-8')
// Minify the HTML
html = minify(html, {
removeComments: true,
preserveLineBreaks: true,
collapseWhitespace: true,
minifyJS: true
})
await fs.writeFile(file, html)
})
)