# Source: https://nextjs.org/docs/pages/api-reference/config/next-config-js/pageExtensions.md

# Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/pageExtensions.md

# Source: https://nextjs.org/docs/pages/api-reference/config/next-config-js/pageExtensions.md

# Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/pageExtensions.md

# Source: https://nextjs.org/docs/pages/api-reference/config/next-config-js/pageExtensions.md

# Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/pageExtensions.md

# Source: https://nextjs.org/docs/pages/api-reference/config/next-config-js/pageExtensions.md

# Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/pageExtensions.md

# Source: https://nextjs.org/docs/pages/api-reference/config/next-config-js/pageExtensions.md

# Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/pageExtensions.md

# pageExtensions
@doc-version: 16.0.4


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 filename="next.config.js"
const withMDX = require('@next/mdx')()

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

module.exports = withMDX(nextConfig)
```