From fe7b46b875e15377c6a4259b6621d45eed312b4e Mon Sep 17 00:00:00 2001 From: Keith Irwin Date: Wed, 18 Oct 2023 01:02:56 -0600 Subject: [PATCH] build: :construction_worker: Import path and use async fs --- eleventy.config.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/eleventy.config.js b/eleventy.config.js index 873506f..107f026 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -1,5 +1,6 @@ const { DateTime } = require('luxon') -const fs = require('fs') +const fs = require('fs').promises +const path = require('path') const markdownIt = require('markdown-it') const markdownItAnchor = require('markdown-it-anchor') const pluginImage = require('@11ty/eleventy-img') @@ -101,8 +102,8 @@ module.exports = function(eleventyConfig) { // Override Browsersync defaults (used only with --serve) eleventyConfig.setBrowserSyncConfig({ callbacks: { - ready: function(err, browserSync) { - const content_404 = fs.readFileSync('_site/404.html') + ready: async (err, browserSync) => { + const content_404 = await fs.readFile('_site/404.html') browserSync.addMiddleware("*", (req, res) => { // Provides the 404 content without redirect.