Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 2 additions & 24 deletions next.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import nextra from 'nextra';

// Set up Nextra with its configuration
// Configure mdxOptions as a function to load plugins at runtime for Turbopack compatibility
const withNextra = nextra({
latex: true,
search: {
Expand All @@ -14,21 +13,8 @@ const withNextra = nextra({
// Refer to this: https://nextra.site/docs/advanced/table
whiteListTagsStyling: ['table', 'thead', 'tbody', 'tr', 'th', 'td'],

// Configure mdxOptions with plugins loaded via require for Turbopack compatibility
// Using require instead of import keeps the config more serializable
mdxOptions: (() => {
// Load plugins using require to avoid top-level imports
const remarkGfm = require('remark-gfm');
const rehypeAttrs = require('rehype-attr');

return {
// Add remark plugins for GitHub Flavored Markdown support
remarkPlugins: [remarkGfm.default || remarkGfm],
rehypePlugins: [
[rehypeAttrs.default || rehypeAttrs, { properties: ['width', 'class'] }]
]
};
})()
// Note: mdxOptions with plugins cannot be serialized in Next.js 16 with Turbopack
// Plugins should be configured through other means if needed
});

// Export the final Next.js config with Nextra included
Expand Down Expand Up @@ -124,12 +110,4 @@ export default withNextra({
},
];
},
// Configure webpack to use memory cache to avoid large string serialization warnings
webpack: (config, { dev, isServer }) => {
// Use memory cache for better performance and to avoid serialization warnings
config.cache = {
type: 'memory',
};
return config;
},
});
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"private": true,
"description": "QueryPie Docs",
"scripts": {
"dev": "next dev --webpack",
"build": "next build --webpack",
"dev": "next dev",
"build": "next build",
"postbuild": "npm run generate-pagefind && npm run generate-sitemap",
"start": "next start",
"lint": "eslint src --max-warnings 0",
Expand Down