1- const fs = require ( ' node:fs' ) ;
2- const inclusiveLangPlugin = require ( ' @11ty/eleventy-plugin-inclusive-language' ) ;
3- const cacheBuster = require ( ' @mightyplow/eleventy-plugin-cache-buster' ) ;
4- const pluginSitemap = require ( ' @quasibit/eleventy-plugin-sitemap' ) ;
5- const htmlmin = require ( ' html-minifier' ) ;
6- const { minify } = require ( ' terser' ) ;
7- const siteSettings = require ( ' ./src/globals/site.json' ) ;
1+ const fs = require ( " node:fs" ) ;
2+ const inclusiveLangPlugin = require ( " @11ty/eleventy-plugin-inclusive-language" ) ;
3+ const cacheBuster = require ( " @mightyplow/eleventy-plugin-cache-buster" ) ;
4+ const pluginSitemap = require ( " @quasibit/eleventy-plugin-sitemap" ) ;
5+ const htmlmin = require ( " html-minifier" ) ;
6+ const { minify } = require ( " terser" ) ;
7+ const siteSettings = require ( " ./src/globals/site.json" ) ;
88
9- const dateFormatter = Intl . DateTimeFormat ( ' en-US' , {
10- year : ' numeric' ,
11- month : ' long' ,
12- day : ' numeric' ,
13- weekday : ' long' ,
14- hour : ' numeric' ,
15- minute : ' numeric' ,
16- timeZoneName : ' short' ,
9+ const dateFormatter = Intl . DateTimeFormat ( " en-US" , {
10+ year : " numeric" ,
11+ month : " long" ,
12+ day : " numeric" ,
13+ weekday : " long" ,
14+ hour : " numeric" ,
15+ minute : " numeric" ,
16+ timeZoneName : " short" ,
1717} ) ;
1818
1919module . exports = function ( eleventyConfig ) {
2020 const runMode = process . env . ELEVENTY_RUN_MODE ;
21- const isProduction = runMode === ' build' ;
21+ const isProduction = runMode === " build" ;
2222
2323 eleventyConfig . addPlugin ( pluginSitemap , {
2424 sitemap : {
2525 hostname : siteSettings . url ,
2626 } ,
2727 } ) ;
2828
29- eleventyConfig . addPassthroughCopy ( { public : './' } ) ;
29+ eleventyConfig . addPassthroughCopy ( { public : "./" } ) ;
3030
31- eleventyConfig . addShortcode ( ' year' , function ( ) {
31+ eleventyConfig . addShortcode ( " year" , function ( ) {
3232 return new Date ( ) . getFullYear ( ) . toString ( ) ;
3333 } ) ;
3434
35- eleventyConfig . addFilter ( ' formatDateTime' , function ( date ) {
35+ eleventyConfig . addFilter ( " formatDateTime" , function ( date ) {
3636 return dateFormatter . format ( date ) ;
3737 } ) ;
3838
3939 eleventyConfig . addPlugin ( inclusiveLangPlugin ) ;
4040
4141 if ( isProduction ) {
42- eleventyConfig . addPlugin ( cacheBuster ( { outputDirectory : ' dist' } ) ) ;
42+ eleventyConfig . addPlugin ( cacheBuster ( { outputDirectory : " dist" } ) ) ;
4343
44- eleventyConfig . addTransform ( ' htmlmin' , function ( content , outputPath ) {
45- if ( outputPath && outputPath . endsWith ( ' .html' ) ) {
44+ eleventyConfig . addTransform ( " htmlmin" , function ( content , outputPath ) {
45+ if ( outputPath && outputPath . endsWith ( " .html" ) ) {
4646 return htmlmin . minify ( content , {
4747 useShortDoctype : true ,
4848 removeComments : true ,
@@ -54,13 +54,13 @@ module.exports = function (eleventyConfig) {
5454 } ) ;
5555 }
5656
57- eleventyConfig . addAsyncFilter ( ' jsmin' , async function ( code ) {
57+ eleventyConfig . addAsyncFilter ( " jsmin" , async function ( code ) {
5858 if ( isProduction ) {
5959 try {
6060 const minified = await minify ( code ) ;
6161 return minified . code ;
6262 } catch ( err ) {
63- console . error ( ' Terser error: ' , err ) ;
63+ console . error ( " Terser error: " , err ) ;
6464 // Fail gracefully.
6565 return code ;
6666 }
@@ -72,11 +72,11 @@ module.exports = function (eleventyConfig) {
7272 return {
7373 pathPrefix : siteSettings . baseUrl ,
7474 dir : {
75- input : ' src' ,
76- output : ' dist' ,
77- includes : ' includes' ,
78- layouts : ' includes/layouts' ,
79- data : ' globals' ,
75+ input : " src" ,
76+ output : " dist" ,
77+ includes : " includes" ,
78+ layouts : " includes/layouts" ,
79+ data : " globals" ,
8080 } ,
8181 } ;
8282} ;
0 commit comments