diff --git a/next.config.mjs b/next.config.mjs index 515d190..2182d78 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,20 +1,7 @@ import { withFaust, getWpHostname } from '@faustwp/core'; import withMarkdoc from '@markdoc/next.js' import withSearch from './markdoc/search.mjs' -import { createRequire } from "module"; - -const require = createRequire(import.meta.url); - -const getAtlasCacheHandler = async ( config = {} ) => { - if (process.env.ATLAS_CACHE_HANDLER_ENABLED === undefined) { - return { ...config }; - } - - return { ...config, ...{ - incrementalCacheHandlerPath: require.resolve('./.atlas/atlas-cache-handler.js'), - isrMemoryCacheSize: 0, - } }; -} +import { withAtlasConfig } from "@wpengine/atlas-next" const getHeaders = async () => { return [ @@ -35,7 +22,6 @@ const nextConfig = { pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'], experimental: { scrollRestoration: true, - ...(await getAtlasCacheHandler()), }, trailingSlash: true, images: { @@ -45,10 +31,11 @@ const nextConfig = { }; -export default withFaust( - withSearch( - withMarkdoc({ - schemaPath: './src/markdoc' - })( nextConfig ) - ) -); +export default withAtlasConfig( + withFaust( + withSearch( + withMarkdoc({ + schemaPath: './src/markdoc' + })( nextConfig ) + ) +)); diff --git a/package-lock.json b/package-lock.json index 1f03e48..8a50c98 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,7 @@ "@radix-ui/react-tabs": "^1.0.4", "@sindresorhus/slugify": "^2.1.1", "@tailwindcss/typography": "^0.5.8", + "@wpengine/atlas-next": "^1.0.0", "acorn": "^8.8.1", "algoliasearch": "^4.14.2", "allotment": "^1.19.3", @@ -5635,6 +5636,18 @@ "node": ">=12" } }, + "node_modules/@wpengine/atlas-next": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@wpengine/atlas-next/-/atlas-next-1.0.0.tgz", + "integrity": "sha512-eqrwYCGiaKIuMziIGnEe2hdEJeaFwZrmgOgXGk68qYsAmEaofN/BKU1tZyyKClgcKNeDl+n4SFAAYR/EfjP9TQ==", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "next": ">=12.2.0 ", + "node-fetch": ">=2.6.1 <3" + } + }, "node_modules/@wry/context": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.7.4.tgz", diff --git a/package.json b/package.json index 20b2e67..ad892b8 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "@radix-ui/react-tabs": "^1.0.4", "@sindresorhus/slugify": "^2.1.1", "@tailwindcss/typography": "^0.5.8", + "@wpengine/atlas-next": "^1.0.0", "acorn": "^8.8.1", "algoliasearch": "^4.14.2", "allotment": "^1.19.3",