build: 👷 Import path and use async fs
parent
c98310be3a
commit
fe7b46b875
|
@ -1,5 +1,6 @@
|
||||||
const { DateTime } = require('luxon')
|
const { DateTime } = require('luxon')
|
||||||
const fs = require('fs')
|
const fs = require('fs').promises
|
||||||
|
const path = require('path')
|
||||||
const markdownIt = require('markdown-it')
|
const markdownIt = require('markdown-it')
|
||||||
const markdownItAnchor = require('markdown-it-anchor')
|
const markdownItAnchor = require('markdown-it-anchor')
|
||||||
const pluginImage = require('@11ty/eleventy-img')
|
const pluginImage = require('@11ty/eleventy-img')
|
||||||
|
@ -101,8 +102,8 @@ module.exports = function(eleventyConfig) {
|
||||||
// Override Browsersync defaults (used only with --serve)
|
// Override Browsersync defaults (used only with --serve)
|
||||||
eleventyConfig.setBrowserSyncConfig({
|
eleventyConfig.setBrowserSyncConfig({
|
||||||
callbacks: {
|
callbacks: {
|
||||||
ready: function(err, browserSync) {
|
ready: async (err, browserSync) => {
|
||||||
const content_404 = fs.readFileSync('_site/404.html')
|
const content_404 = await fs.readFile('_site/404.html')
|
||||||
|
|
||||||
browserSync.addMiddleware("*", (req, res) => {
|
browserSync.addMiddleware("*", (req, res) => {
|
||||||
// Provides the 404 content without redirect.
|
// Provides the 404 content without redirect.
|
||||||
|
|
Loading…
Reference in New Issue