跳到主要内容
版本:3.2.1

📦 plugin-debug

The debug plugin will display useful debug information at http://localhost:3000/__docusaurus/debug.

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.

信息

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.

如果你用的是独立插件,你可能需要通过检查环境来实现同样的效果:

docusaurus.config.js
export default {
plugins: [
process.env.NODE_ENV === 'production' && '@docusaurus/plugin-debug',
].filter(Boolean),
};
备注

如果你报告了一个漏洞,我们可能会要求你在网站的生产环境中开启此插件,让我们能更方便地检查你的开发配置。

If you don't have any sensitive information, you can keep it on in production like we do.

Installation

npm install --save @docusaurus/plugin-debug
提示

If you use the preset @docusaurus/preset-classic, you don't need to install this plugin as a dependency.

You can configure this plugin through the preset options.

Configuration

这个插件目前没有选项。

Example configuration

你可以通过预设选项或插件选项来配置这个插件。

提示

大多数 Docusaurus 用户通过预设选项配置此插件。

If you use a preset, configure this plugin through the preset options:

docusaurus.config.js
export default {
presets: [
[
'@docusaurus/preset-classic',
{
debug: true, // This will enable the plugin in production
},
],
],
};