[next.config][s]: switch next.config from using require to import

This commit is contained in:
Rising Odegua 2022-03-07 11:57:34 +01:00
parent 3094d5c876
commit e41c34fc8f
2 changed files with 18 additions and 19 deletions

View File

@ -1,19 +0,0 @@
const toc = require('remark-toc')
const slug = require('remark-slug')
const gfm = require('remark-gfm')
const footnotes = require('remark-footnotes')
const withMDX = require('@next/mdx')({
extension: /\.mdx?$/,
options: {
remarkPlugins: [gfm, toc, slug, footnotes],
rehypePlugins: [],
providerImportSource: '@mdx-js/react',
},
})
module.exports = withMDX({
// Append the default value with md extensions
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
})

View File

@ -0,0 +1,18 @@
import gfm from 'remark-gfm'
import toc from 'remark-toc'
import slug from 'remark-slug'
import withMDXImp from '@next/mdx'
const withMDX = withMDXImp({
extension: /\.mdx?$/,
options: {
remarkPlugins: [gfm, toc, slug],
rehypePlugins: [],
// If you use `MDXProvider`, uncomment the following line.
providerImportSource: "@mdx-js/react",
},
})
export default withMDX({
// Append the default value with md extensions
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
})