config: use string-format plugin config for Turbopack compatibility

This commit is contained in:
2026-06-02 11:24:57 -05:00
parent 75214a3b64
commit c65e58023d

View File

@@ -1,13 +1,5 @@
import type { NextConfig } from 'next' import type { NextConfig } from 'next'
import createMDX from '@next/mdx' import createMDX from '@next/mdx'
import remarkSmartypants from 'remark-smartypants'
import remarkMath from 'remark-math'
import remarkGfm from 'remark-gfm'
import rehypeSlug from 'rehype-slug'
import rehypeExternalLinks from 'rehype-external-links'
import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import rehypePrettyCode from 'rehype-pretty-code'
import rehypeKatex from 'rehype-katex'
const nextConfig: NextConfig = { const nextConfig: NextConfig = {
output: 'export', output: 'export',
@@ -17,22 +9,20 @@ const nextConfig: NextConfig = {
const withMDX = createMDX({ const withMDX = createMDX({
options: { options: {
remarkPlugins: [remarkSmartypants, remarkMath, remarkGfm], remarkPlugins: ['remark-smartypants', 'remark-math', 'remark-gfm'],
rehypePlugins: [ rehypePlugins: [
rehypeSlug, 'rehype-slug',
[rehypeExternalLinks, { target: '_blank', rel: ['nofollow', 'noopener', 'noreferrer'] }], ['rehype-external-links', { target: '_blank', rel: ['nofollow', 'noopener', 'noreferrer'] }],
rehypeAutolinkHeadings, 'rehype-autolink-headings',
[rehypePrettyCode, { ['rehype-pretty-code', {
theme: { light: 'github-light', dark: 'github-dark-dimmed' }, theme: { light: 'github-light', dark: 'github-dark-dimmed' },
keepBackground: false, keepBackground: false,
lineNumbers: true, lineNumbers: true,
grid: true, grid: true,
}], }],
rehypeKatex, 'rehype-katex',
], ],
}, },
}) })
const config = withMDX(nextConfig) export default withMDX(nextConfig)
config.turbopack = {}
export default config