pageExtensions
デフォルトでは、Next.js は以下の拡張子のファイルを受け付けます: .tsx
, .ts
, .jsx
, .js
。これは markdown (.md
, .mdx
) などの他の拡張子を許可するように変更できます。
const withMDX = require('@next/mdx')()
/** @type {import('next').NextConfig} */
const nextConfig = {
pageExtensions: ['ts', 'tsx', 'mdx'],
experimental: {
mdxRs: true,
},
}
module.exports = withMDX(nextConfig)