Skip to content

pageExtensions

默认情况下,Next.js 接受具有以下扩展名的文件:.tsx, .ts, .jsx, .js.可以修改它以允许其他扩展,例如 markdown (.md, .mdx)。

¥By default, Next.js accepts files with the following extensions: .tsx, .ts, .jsx, .js. This can be modified to allow other extensions like markdown (.md, .mdx).

js
const withMDX = require('@next/mdx')()

/** @type {import('next').NextConfig} */
const nextConfig = {
  pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'md', 'mdx'],
}

module.exports = withMDX(nextConfig)

Next.js v15.2 中文网 - 粤ICP备13048890号