pageExtensions
Par défaut, Next.js accepte les fichiers avec les extensions suivantes : .tsx
, .ts
, .jsx
, .js
. Cela peut être modifié pour autoriser d'autres extensions comme 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)