chore: cleanup and refactor

This commit is contained in:
Cory Dransfeldt 2023-12-11 11:00:39 -08:00
parent b6fb54ab98
commit 5295a6eacc
No known key found for this signature in database
37 changed files with 285 additions and 356 deletions

View file

@ -0,0 +1,18 @@
const htmlmin = require('html-minifier-terser')
const isProduction = process.env.ELEVENTY_ENV === 'production'
module.exports = (eleventyConfig) => {
eleventyConfig.addTransform('html-minify', (content, path) => {
if (path && path.endsWith('.html') && isProduction) {
return htmlmin.minify(content, {
collapseBooleanAttributes: true,
collapseWhitespace: true,
decodeEntities: true,
includeAutoGeneratedTags: false,
removeComments: true,
})
}
return content
})
}