跳转至主内容
Version: 2.0.0-beta.15

📦 plugin-debug

调试插件将在 http://localhost:3000/__docusaurus/debug 上输出有用的调试信息。

本插件适合插件作者使用,方便您检视位于 .docusaurus 文件夹中的内容(如创建路由)和不会写入文件系统中的数据结构,如透过 contentLoaded 生命周期所加载的插件数据。

信息

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:

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

若您发现漏洞,我们可能会请求您在生产页面的网站上开启此插件,进而让我们更方便地检查您的开发配置。

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

安装

npm install --save @docusaurus/plugin-debug
tip

若您已安装 @docusaurus/preset-classic,您则并不需要安装此依赖。

You can configure this plugin through the preset options.

配置

This plugin currently has no options.

示例配置

You can configure this plugin through preset options or plugin options.

tip

Most Docusaurus users configure this plugin through the preset options.

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

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