Aller au contenu principal
Version : 2.4.3

📦 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.

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.

Si vous utilisez un plugin autonome, vous devrez peut-être obtenir le même effet en vérifiant l'environnement :

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

Si vous signalez un bogue, nous vous demanderons probablement d'activer ce plugin en production, afin que nous puissions inspecter votre configuration de déploiement plus facilement.

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
astuce

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

Vous pouvez configurer ce plugin via les options du preset.

Configuration​

Ce plugin n'a actuellement aucune option.

Example configuration​

Vous pouvez configurer ce plugin via les options du preset ou du plugin.

astuce

La plupart des utilisateurs de Docusaurus configurent ce plugin via les options du preset.

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

docusaurus.config.js
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
debug: true, // Ceci permettra d'activer le plugin en production
},
],
],
};