docs: fix rewrites in sub-projects to prevent loop on 404 page (#8255)

This commit is contained in:
Shahed Nasser
2024-07-24 17:06:54 +03:00
committed by GitHub
parent a356d12ac4
commit 7a0941e997
4 changed files with 1 additions and 54 deletions

View File

@@ -4,19 +4,6 @@ import bundleAnalyzer from "@next/bundle-analyzer"
/** @type {import('next').NextConfig} */
const nextConfig = {
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/v2/api",
async rewrites() {
return {
fallback: [
{
source: "/:path*",
destination: `${
process.env.NEXT_PUBLIC_DOCS_URL || "https://localhost:3001"
}/:path*`,
basePath: false,
},
],
}
},
webpack: (config) => {
config.ignoreWarnings = [{ module: /node_modules\/keyv\/src\/index\.js/ }]

View File

@@ -29,19 +29,6 @@ const nextConfig = {
transpilePackages: ["docs-ui"],
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/v2/resources",
async rewrites() {
return {
fallback: [
{
source: "/:path*",
destination: `${
process.env.NEXT_PUBLIC_DOCS_URL || "https://localhost:3001"
}/:path*`,
basePath: false,
},
],
}
},
async redirects() {
// redirect original file paths to the rewrite
return slugChanges.map((item) => ({

View File

@@ -3,19 +3,6 @@ const { withContentlayer } = require("next-contentlayer")
/** @type {import('next').NextConfig} */
const nextConfig = {
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/ui",
async rewrites() {
return {
fallback: [
{
source: "/:path*",
destination: `${
process.env.NEXT_PUBLIC_DOCS_URL || "https://localhost:3001"
}/:path*`,
basePath: false,
},
],
}
},
reactStrictMode: true,
}

View File

@@ -82,21 +82,7 @@ const nextConfig = {
transpilePackages: ["docs-ui"],
// TODO uncomment if we decide on baes path
// basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/v2/user-guide",
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/user-guide",
async rewrites() {
return {
fallback: [
{
source: "/:path*",
destination: `${
process.env.NEXT_PUBLIC_DOCS_URL || "https://localhost:3001"
}/:path*`,
basePath: false,
},
],
}
},
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/v2/user-guide",
}
export default withMDX(nextConfig)