---
title: mdxRs
description: Use the new Rust compiler to compile MDX files in the App Router.
url: "https://nextjs.org/docs/14/app/api-reference/next-config-js/mdxRs"
version: 14.2.35
lastUpdated: 2023-06-08
prerequisites:
  - "API Reference: /docs/14/app/api-reference"
  - "next.config.js Options: /docs/14/app/api-reference/next-config-js"
---


For use with `@next/mdx`. Compile MDX files using the new Rust compiler.

```js filename="next.config.js"
const withMDX = require('@next/mdx')()

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

module.exports = withMDX(nextConfig)
```
---

For an index of all available documentation, see [/docs/14/llms.txt](/docs/14/llms.txt)