Custom Page Extensions

Aimed at modules like @next/mdx, which adds support for pages ending with .mdx. You can configure the extensions looked for in the pages directory when resolving pages.

Open next.config.js and add the pageExtensions config:

  1. module.exports = {
  2. pageExtensions: ['mdx', 'jsx', 'js', 'ts', 'tsx'],
  3. }

Related

[

Introduction to next.config.js

Learn more about the configuration file used by Next.js.]($0b4bd5a3a6817758.md)