Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

Commit

Permalink
configure Turbopack
Browse files Browse the repository at this point in the history
  • Loading branch information
aminahbl committed Jun 4, 2024
1 parent 90da986 commit 8e7ec1f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
16 changes: 14 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
const { i18n } = require("./next-i18next.config");
const nextMDX = require("@next/mdx");
const path = require("path");

/** @type {import("next").NextConfig} */
const nextConfig = {
i18n,
reactStrictMode: true,
compiler: { emotion: true },
pageExtensions: ["js", "jsx", "ts", "tsx", "md", "mdx"],
experimental: {
turbo: {
resolveExtensions: [
".mdx",
".md",
".tsx",
".ts",
".jsx",
".js",
".mjs",
".json",
],
},
},
};

const withMDX = nextMDX({
Expand Down
6 changes: 5 additions & 1 deletion utils/mdxPageHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ export function getMDXContentBySlug(
}

export function getAllPosts(pathBaseItems: string[], lang: string) {
const slugs = fs.readdirSync(path.join(...pathBaseItems));
const dirPath = pathBaseItems
.reduce((acc, item) => `${acc}/${item}`, "")
.slice(1);

const slugs = fs.readdirSync(dirPath);

const posts = slugs
.map((slug) => getMDXContentBySlug(pathBaseItems.join("/"), slug, lang))
Expand Down

0 comments on commit 8e7ec1f

Please sign in to comment.