build: 👷 Import path and use async fs

master
Keith Irwin 2023-10-18 01:02:56 -06:00
parent c98310be3a
commit fe7b46b875
Signed by: ki9
GPG Key ID: DF773B3F4A88DA86
1 changed files with 4 additions and 3 deletions

View File

@ -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.