Created
May 12, 2024 10:25
-
-
Save sachithrrra/d8befaffe6de2de608289218a4e798bb to your computer and use it in GitHub Desktop.
nextjs chaining multiple plugins with configs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { paraglide } from "@inlang/paraglide-next/plugin"; | |
import createMDX from "@next/mdx"; | |
// Define paraglide configuration | |
const paraglideConfig = { | |
paraglide: { | |
project: "./project.inlang", | |
outdir: "./src/paraglide", | |
}, | |
basePath: "", | |
}; | |
// Define Next.js config | |
const nextConfig = { | |
// Configure `pageExtensions` to include markdown and MDX files | |
pageExtensions: ["js", "jsx", "md", "mdx", "ts", "tsx"], | |
// Optionally, add any other Next.js config below | |
}; | |
// Configure MDX | |
const withMDX = createMDX({ | |
// Add markdown plugins here, as desired | |
}); | |
// Merge paraglide config with Next.js config | |
const mergedConfig = { | |
...nextConfig, | |
...paraglideConfig, | |
}; | |
// Merge MDX config with merged config | |
const finalConfig = withMDX(mergedConfig); | |
export default paraglide(finalConfig); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment