Skip to content

Instantly share code, notes, and snippets.

@sachithrrra
Created May 12, 2024 10:25
Show Gist options
  • Save sachithrrra/d8befaffe6de2de608289218a4e798bb to your computer and use it in GitHub Desktop.
Save sachithrrra/d8befaffe6de2de608289218a4e798bb to your computer and use it in GitHub Desktop.
nextjs chaining multiple plugins with configs
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