# Fumadocs MDX (the built-in content source): グローバルオプション
URL: /ja/docs/mdx/global
Source: https://raw.githubusercontent.com/fuma-nama/fumadocs/refs/heads/main/apps/docs/content/docs/mdx/global.ja.mdx

Fumadocs MDX のカスタマイズ

すべてのコレクションに適用される MDX プラグインなど、Fumadocs MDX のグローバルオプションは、プロジェクトルートの `source.config.ts` に記述します。このファイルは省略可能で、`lib/source.ts` で [Macro API](/docs/mdx/macro) を使って定義したコレクションでも機能します。

## グローバルオプション [#global-options]

```ts title="source.config.ts"
import { defineConfig } from 'fumadocs-mdx/config';

export default defineConfig({
  // グローバルオプション
});
```

### GlobalConfig

| Prop                      | Type                                                                             | Description                                                                                                                                                                       |
| ------------------------- | -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `plugins?`                | `PluginOption[] \| undefined`                                                    |                                                                                                                                                                                   |
| `compiler?`               | `"mdx" \| "satteri" \| undefined`                                                | The compiler for files compiled without a collection (e.g. `page.mdx` routes). Collections choose their own compiler via the collection-level `compiler` option. Default: `'mdx'` |
| `mdxOptions?`             | `(() => Promise<MDXPresetOptions>) \| MDXPresetOptions \| undefined`             | Configure global MDX options, used by `doc` collections with the default MDX compiler.                                                                                            |
| `satteriOptions?`         | `SatteriOptionsInput`                                                            | Configure global Sätteri options, used by `doc` collections with `compiler: "satteri"`.                                                                                           |
| `workspaces?`             | `Record<string, { dir: string; config: Record<string, unknown>; }> \| undefined` |                                                                                                                                                                                   |
| `experimentalBuildCache?` | `string \| undefined`                                                            |                                                                                                                                                                                   |

### MDX オプション [#mdx-options]

コレクションの[デフォルトプリセット](/docs/mdx/mdx)をカスタマイズします。`mdxOptions` は unified でコンパイルされるコレクションに、`satteriOptions` は `compiler: 'satteri'` を指定したコレクションに適用されます。

```ts tab="unified" title="source.config.ts"
import { defineConfig } from 'fumadocs-mdx/config';
import { myPlugin } from './remark-plugin';

export default defineConfig({
  mdxOptions: {
    // 順序が重要な場合
    remarkPlugins: (v) => [myPlugin, ...v],
  },
});
```

```ts tab="Sätteri" title="source.config.ts"
import { defineConfig } from 'fumadocs-mdx/config';
import { myPlugin } from './mdast-plugin';

export default defineConfig({
  satteriOptions: {
    // 順序が重要な場合
    mdastPlugins: (v) => [myPlugin(), ...v],
  },
});
```

または、minimal プリセットを使用する場合は次のとおりです。

```ts tab="unified" title="source.config.ts"
import { defineConfig } from 'fumadocs-mdx/config';

export default defineConfig({
  mdxOptions: {
    preset: 'minimal',
    // この場合、MDX プロセッサーのオプションのみを受け付けます
  },
});
```

```ts tab="Sätteri" title="source.config.ts"
import { defineConfig } from 'fumadocs-mdx/config';

export default defineConfig({
  satteriOptions: {
    preset: 'minimal',
    // この場合、Sätteri のコンパイルオプションのみを受け付けます
  },
});
```