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