File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { minify } from "html-minifier" ;
2-
31import { createRequire } from "node:module" ;
4- import { readFileSync } from "fs" ;
52
63const require = createRequire ( import . meta. url ) ;
74const collectionControl = require ( "./src/_data/collectionsControl.json" ) ;
@@ -51,13 +48,13 @@ export default function (eleventyConfig) {
5148 "./src/pages/garden/node/Assets/*" : "assets" ,
5249 } ) ;
5350
54- eleventyConfig . addTransform ( "html" , function ( content ) {
51+ eleventyConfig . addTransform ( "html" , async function ( content ) {
5552 if (
5653 this . page . outputPath &&
5754 this . page . outputPath . endsWith ( ".html" ) &&
5855 process . env . ELEVENTY_ENV == "production"
5956 ) {
60- return minify ( content , {
57+ return ( await import ( "html-minifier" ) ) . minify ( content , {
6158 useShortDoctype : true ,
6259 removeComments : true ,
6360 collapseWhitespace : true ,
You can’t perform that action at this time.
0 commit comments