๐ฆ 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.
๋ ๋ฆฝ ์คํํ ํ๋ฌ๊ทธ์ธ์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ์๋ ํ๊ฒฝ ์ค์ ํ์ธ ํ ๊ฐ์ ํจ๊ณผ๋ฅผ ์ป์ ์ ์์ต๋๋ค.
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
- Yarn
- pnpm
- Bun
npm install --save @docusaurus/plugin-debug
yarn add @docusaurus/plugin-debug
pnpm add @docusaurus/plugin-debug
bun add @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โ
ํ๋ฆฌ์ ์ต์ ์ด๋ ํ๋ฌ๊ทธ์ธ ์ต์ ์์ ํ๋ฌ๊ทธ์ธ์ ์ค์ ํ ์ ์์ต๋๋ค.
๋๋ถ๋ถ์ ๋ํ์ฌ์ฐ๋ฃจ์ค ์ฌ์ฉ์๋ ํ๋ฆฌ์ ์ต์ ์ ์ฌ์ฉํด ํ๋ฌ๊ทธ์ธ์ ์ค์ ํฉ๋๋ค.
- Preset options
- Plugin Options
If you use a preset, configure this plugin through the preset options:
export default {
presets: [
[
'@docusaurus/preset-classic',
{
debug: true, // This will enable the plugin in production
},
],
],
};
๋ ๋ฆฝ์ ์ผ๋ก ์คํ๋๋ ํ๋ฌ๊ทธ์ธ์ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ์๋ ํ๋ฌ๊ทธ์ธ์ ๋ํ ์ต์ ์ ์ง์ ์ค์ ํ ์ ์์ต๋๋ค.
export default {
plugins: ['@docusaurus/plugin-debug'],
};