docs: fix rewrites in sub-projects to prevent loop on 404 page (#8255)
This commit is contained in:
@@ -4,19 +4,6 @@ import bundleAnalyzer from "@next/bundle-analyzer"
|
|||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/v2/api",
|
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) => {
|
webpack: (config) => {
|
||||||
config.ignoreWarnings = [{ module: /node_modules\/keyv\/src\/index\.js/ }]
|
config.ignoreWarnings = [{ module: /node_modules\/keyv\/src\/index\.js/ }]
|
||||||
|
|
||||||
|
|||||||
@@ -29,19 +29,6 @@ const nextConfig = {
|
|||||||
transpilePackages: ["docs-ui"],
|
transpilePackages: ["docs-ui"],
|
||||||
|
|
||||||
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/v2/resources",
|
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() {
|
async redirects() {
|
||||||
// redirect original file paths to the rewrite
|
// redirect original file paths to the rewrite
|
||||||
return slugChanges.map((item) => ({
|
return slugChanges.map((item) => ({
|
||||||
|
|||||||
@@ -3,19 +3,6 @@ const { withContentlayer } = require("next-contentlayer")
|
|||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/ui",
|
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,
|
reactStrictMode: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,21 +82,7 @@ const nextConfig = {
|
|||||||
|
|
||||||
transpilePackages: ["docs-ui"],
|
transpilePackages: ["docs-ui"],
|
||||||
// TODO uncomment if we decide on baes path
|
// 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 || "/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,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default withMDX(nextConfig)
|
export default withMDX(nextConfig)
|
||||||
|
|||||||
Reference in New Issue
Block a user