Files
medusa-store/www/apps/api-reference/next.config.mjs

41 lines
938 B
JavaScript

import mdx from "@next/mdx"
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/ }]
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))