Files
medusa-store/www/apps/api-reference/next.config.mjs
Shahed Nasser 728c5ee53c docs: preparations for preview (#7267)
* configured base paths + added development banner

* fix typelist site url

* added navbar and sidebar badges

* configure algolia filters

* remove AI assistant

* remove unused imports

* change navbar text and badge

* lint fixes

* fix build error

* add to api reference rewrites

* fix build error

* fix build errors in user-guide

* fix feedback component

* add parent title to pagination

* added breadcrumbs component

* remove user-guide links

* resolve todos

* fix details about authentication

* change documentation title

* lint content
2024-05-13 11:32:52 +03:00

68 lines
1.6 KiB
JavaScript

import mdx from "@next/mdx"
import bundleAnalyzer from "@next/bundle-analyzer"
/** @type {import('next').NextConfig} */
const nextConfig = {
async rewrites() {
const fallbacks = [
{
source: "/ui",
destination: `${process.env.NEXT_PUBLIC_UI_URL}/ui`,
},
{
source: "/ui/:path*",
destination: `${process.env.NEXT_PUBLIC_UI_URL}/ui/:path*`,
},
{
source: "/:path*",
destination: `${process.env.NEXT_PUBLIC_DOCS_URL}/:path*`,
},
]
if (process.env.NEXT_PUBLIC_SHOW_V2) {
fallbacks.push(
{
source: "/v2/resources",
destination: `${process.env.NEXT_PUBLIC_DOCS_V2_URL}/v2/resources`,
},
{
source: "/v2/resources/:path*",
destination: `${process.env.NEXT_PUBLIC_DOCS_V2_URL}/v2/resources/:path*`,
},
{
source: "/v2",
destination: `${process.env.NEXT_PUBLIC_DOCS_V2_URL}/v2`,
},
{
source: "/v2/:path*",
destination: `${process.env.NEXT_PUBLIC_DOCS_V2_URL}/v2/:path*`,
}
)
}
return {
fallback: fallbacks,
}
},
webpack: (config) => {
config.ignoreWarnings = [{ module: /node_modules\/keyv\/src\/index\.js/ }]
return config
},
transpilePackages: ["docs-ui"],
}
const withMDX = mdx({
extension: /\.mdx?$/,
options: {
rehypePlugins: [],
development: process.env.NODE_ENV === "development",
},
})
const withBundleAnalyzer = bundleAnalyzer({
enabled: process.env.ANALYZE_BUNDLE === "true",
})
export default withBundleAnalyzer(withMDX(nextConfig))