[next.config][s]: switch next.config from using require to import
This commit is contained in:
parent
3094d5c876
commit
e41c34fc8f
@ -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'],
|
||||
})
|
||||
18
examples/data-literate/next.config.mjs
Normal file
18
examples/data-literate/next.config.mjs
Normal 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'],
|
||||
})
|
||||
Loading…
x
Reference in New Issue
Block a user