config: use string-format plugin config for Turbopack compatibility
This commit is contained in:
@@ -1,13 +1,5 @@
|
||||
import type { NextConfig } from 'next'
|
||||
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 = {
|
||||
output: 'export',
|
||||
@@ -17,22 +9,20 @@ const nextConfig: NextConfig = {
|
||||
|
||||
const withMDX = createMDX({
|
||||
options: {
|
||||
remarkPlugins: [remarkSmartypants, remarkMath, remarkGfm],
|
||||
remarkPlugins: ['remark-smartypants', 'remark-math', 'remark-gfm'],
|
||||
rehypePlugins: [
|
||||
rehypeSlug,
|
||||
[rehypeExternalLinks, { target: '_blank', rel: ['nofollow', 'noopener', 'noreferrer'] }],
|
||||
rehypeAutolinkHeadings,
|
||||
[rehypePrettyCode, {
|
||||
'rehype-slug',
|
||||
['rehype-external-links', { target: '_blank', rel: ['nofollow', 'noopener', 'noreferrer'] }],
|
||||
'rehype-autolink-headings',
|
||||
['rehype-pretty-code', {
|
||||
theme: { light: 'github-light', dark: 'github-dark-dimmed' },
|
||||
keepBackground: false,
|
||||
lineNumbers: true,
|
||||
grid: true,
|
||||
}],
|
||||
rehypeKatex,
|
||||
'rehype-katex',
|
||||
],
|
||||
},
|
||||
})
|
||||
|
||||
const config = withMDX(nextConfig)
|
||||
config.turbopack = {}
|
||||
export default config
|
||||
export default withMDX(nextConfig)
|
||||
|
||||
Reference in New Issue
Block a user