📦 plugin-debug
O plugin de depuração exibirá informações úteis de depuração em http://localhost:3000/__docusaurus/debug.
É principalmente útil para autores de plug-ins, que serão capazes de inspecionar mais facilmente o conteúdo da pasta .docusaurus
(como as rotas de criação), mas também serão capazes de inspecionar estruturas de dados que nunca são gravadas disco, como os dados do plugin carregados por meio do ciclo de vida contentLoaded
.
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:
module.exports = {
plugins: [
process.env.NODE_ENV === 'production' && '@docusaurus/plugin-debug',
].filter(Boolean),
};
note
Se você relatar um bug, provavelmente pediremos que este plugin seja ativado na produção, para que possamos inspecionar sua configuração de implantação com mais facilidade.
If you don't have any sensitive information, you can keep it on in production like we do.
Instalação
- npm
- Yarn
npm install --save @docusaurus/plugin-debug
yarn add @docusaurus/plugin-debug
tip
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.
Configuração
This plugin currently has no options.
Configuração de exemplo
You can configure this plugin through preset options or plugin options.
tip
Most Docusaurus users configure this plugin through the preset options.
- Preset Options
- Plugin Options
If you use a preset, configure this plugin through the preset options:
module.exports = {
presets: [
[
'@docusaurus/preset-classic',
{
debug: true, // This will enable the plugin in production
},
],
],
};
If you are using a standalone plugin, provide options directly to the plugin:
module.exports = {
plugins: ['@docusaurus/plugin-debug'],
};