wonderfulfrog.com/config/transforms/html-config.js
Devin Haska 2aa912399c feat: add postcss filter
All CSS processing is handled by the filter, and is now inlined into the
HTML
2025-03-16 12:07:31 -07:00

20 lines
623 B
JavaScript

import htmlmin from "html-minifier-terser";
export default function (eleventyConfig) {
eleventyConfig.addTransform("html-minify", (content, path) => {
if (path && path.endsWith(".html")) {
return htmlmin.minify(content, {
collapseBooleanAttributes: true,
collapseWhitespace: true,
decodeEntities: true,
includeAutoGeneratedTags: false,
minifyCSS: false, // Disabled because of clean-css' lack of nested CSS support
minifyJS: true,
minifyURLs: true,
removeComments: true,
useShortDoctype: true,
});
}
return content;
});
}