docs: fix index.html.md causing 404 (#12241)

* docs: fix index.html.md causing 404

* update next.js

* test

* test

* test

* test

* fix revalidate

* test

* test

* test

* test

* test

* test

* test

* test

* clean up
This commit is contained in:
Shahed Nasser
2025-04-18 18:08:54 +03:00
committed by GitHub
parent 2e65f7ffc0
commit f3cb8f2e03
12 changed files with 1398 additions and 44 deletions
@@ -31,7 +31,7 @@ export async function GET(req: NextRequest, { params }: Params) {
return notFound()
}
const filePath = path.join(path.resolve("..", "..", ".."), filePathFromMap)
const filePath = path.join(process.cwd(), "..", "..", "..", filePathFromMap)
if (!existsSync(filePath)) {
return notFound()
+5 -1
View File
@@ -58,7 +58,7 @@ const nextConfig = {
// Configure `pageExtensions` to include MDX files
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
transpilePackages: ["docs-ui"],
transpilePackages: ["docs-ui", "next-mdx-remote"],
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/resources",
async redirects() {
@@ -178,6 +178,10 @@ const nextConfig = {
outputFileTracingExcludes: {
"*": ["node_modules/@medusajs/icons"],
},
outputFileTracingIncludes: {
"/md\\-content/\\[\\[\\.\\.\\.slug\\]\\]": ["./app/**/*.mdx"],
"/md\\-content/references/**": ["./references/**/*.mdx"],
},
experimental: {
optimizePackageImports: ["@medusajs/icons", "@medusajs/ui", "elkjs"],
},
+2 -2
View File
@@ -17,10 +17,10 @@
"@mdx-js/loader": "^3.1.0",
"@mdx-js/react": "^3.1.0",
"@medusajs/icons": "~2.5.1",
"@next/mdx": "15.0.4",
"@next/mdx": "15.3.1",
"clsx": "^2.1.0",
"docs-ui": "*",
"next": "15.0.4",
"next": "15.3.1",
"react": "rc",
"react-dom": "rc",
"rehype-mdx-code-props": "^2.0.0",