2020-11-30 08:07:08 -05:00
---
2021-11-10 01:08:50 -05:00
sidebar_position: 5
2022-05-28 07:07:45 -04:00
slug: /api/plugins/@docusaurus/plugin-debug
2020-11-30 08:07:08 -05:00
---
2022-05-28 07:07:45 -04:00
# 📦 plugin-debug
2021-12-28 08:23:27 -05:00
```mdx-code-block
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
```
2023-08-11 20:56:54 -04:00
The debug plugin will display useful debug information at [`http://localhost:3000/__docusaurus/debug`](http://localhost:3000/__docusaurus/debug).
2020-11-30 08:07:08 -05:00
It is mostly useful for plugin authors, that will be able to inspect more easily the content of the `.docusaurus` folder (like the creates routes), but also be able to inspect data structures that are never written to disk, like the plugin data loaded through the `contentLoaded` lifecycle.
2021-12-28 08:23:27 -05:00
:::info
If you use the plugin via the classic preset, the preset will **enable the plugin in development and disable it in production** by default (`debug: undefined`) to avoid exposing potentially sensitive information. You can use `debug: true` to always enable it or `debug: false` to always disable it.
If you use a standalone plugin, you may need to achieve the same effect by checking the environment:
```js title="docusaurus.config.js"
2023-10-13 20:46:03 -04:00
export default {
2021-12-28 08:23:27 -05:00
plugins: [
// highlight-next-line
process.env.NODE_ENV === 'production' && '@docusaurus/plugin-debug',
].filter(Boolean),
};
```
:::
2020-11-30 08:07:08 -05:00
:::note
If you report a bug, we will probably ask you to have this plugin turned on in the production, so that we can inspect your deployment config more easily.
2021-12-28 08:23:27 -05:00
If you don't have any sensitive information, you can keep it on in production [like we do](/__docusaurus/debug).
2020-11-30 08:07:08 -05:00
:::
2021-03-19 06:00:41 -04:00
## Installation {#installation}
2020-11-30 08:07:08 -05:00
```bash npm2yarn
npm install --save @docusaurus/plugin-debug
```
:::tip
2021-12-28 08:23:27 -05:00
If you use the preset `@docusaurus/preset-classic`, you don't need to install this plugin as a dependency.
2020-11-30 08:07:08 -05:00
2021-12-28 08:23:27 -05:00
You can configure this plugin through the preset options.
2020-11-30 08:07:08 -05:00
:::
2021-03-19 06:00:41 -04:00
## Configuration {#configuration}
2020-11-30 08:07:08 -05:00
2021-12-28 08:23:27 -05:00
This plugin currently has no options.
### Example configuration {#ex-config}
You can configure this plugin through preset options or plugin options.
:::tip
Most Docusaurus users configure this plugin through the preset options.
:::
2022-06-05 03:41:06 -04:00
```mdx-code-block
2022-06-05 22:52:19 -04:00
<Tabs groupId="api-config-ex">
<TabItem value="preset" label="Preset options">
2022-06-05 03:41:06 -04:00
```
2021-12-28 08:23:27 -05:00
2022-12-30 09:08:28 -05:00
If you use a preset, configure this plugin through the [preset options](../../using-plugins.mdx#docusauruspreset-classic):
2021-12-28 08:23:27 -05:00
2020-11-30 08:07:08 -05:00
```js title="docusaurus.config.js"
2023-10-13 20:46:03 -04:00
export default {
2021-12-28 08:23:27 -05:00
presets: [
[
'@docusaurus/preset-classic',
{
// highlight-next-line
debug: true, // This will enable the plugin in production
},
],
],
};
```
2022-06-05 03:41:06 -04:00
```mdx-code-block
2021-12-28 08:23:27 -05:00
</TabItem>
2022-06-05 22:52:19 -04:00
<TabItem value="plugin" label="Plugin Options">
2022-06-05 03:41:06 -04:00
```
2021-12-28 08:23:27 -05:00
If you are using a standalone plugin, provide options directly to the plugin:
```js title="docusaurus.config.js"
2023-10-13 20:46:03 -04:00
export default {
2021-12-28 08:23:27 -05:00
// highlight-next-line
2020-11-30 08:07:08 -05:00
plugins: ['@docusaurus/plugin-debug'],
};
```
2021-12-28 08:23:27 -05:00
2022-06-05 03:41:06 -04:00
```mdx-code-block
2021-12-28 08:23:27 -05:00
</TabItem>
</Tabs>
2022-06-05 03:41:06 -04:00
```