From c451f2690db712218388411f835b1b62b5e9e0f0 Mon Sep 17 00:00:00 2001 From: Jason Bahl Date: Fri, 12 Jan 2024 19:59:06 -0700 Subject: [PATCH] - modify config --- next.config.mjs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/next.config.mjs b/next.config.mjs index c08b2b4..03efd36 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -3,7 +3,7 @@ import withMarkdoc from '@markdoc/next.js' import withSearch from './markdoc/search.mjs' const getAtlasCacheHandler = async ( config = {} ) => { - if (process.env.ATLAS_CACHE_HANDLER_ENABLED === undefined) { + if (process.env.ATLAS_CACHE_HANDLER_ENABLED === undefined || process.env.ATLAS_CACHE_HANDLER_ENABLED !== 'true') { return config; } @@ -15,13 +15,14 @@ const getAtlasCacheHandler = async ( config = {} ) => { } }; } -const nextConfig = () => { +const nextConfig = async () => { return { reactStrictMode: true, pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'], - experimental: getAtlasCacheHandler({ + experimental: { scrollRestoration: true, - }), + ...(await getAtlasCacheHandler()), + }, trailingSlash: true, images: { domains: [ getWpHostname() ],