"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["27749"],{71602:function(e,r,n){n.r(r),n.d(r,{metadata:()=>t,contentTitle:()=>s,default:()=>h,assets:()=>d,toc:()=>p,frontMatter:()=>c});var t=JSON.parse('{"id":"api/plugins/plugin-rsdoctor","title":"\uD83D\uDCE6 plugin-rsdoctor","description":"A Rsdoctor plugin can help you troubleshoot the bundling phase of your Docusaurus site, supporting both Webpack and Rspack.","source":"@site/docs/api/plugins/plugin-rsdoctor.mdx","sourceDirName":"api/plugins","slug":"/api/plugins/@docusaurus/plugin-rsdoctor","permalink":"/docs/api/plugins/@docusaurus/plugin-rsdoctor","draft":false,"unlisted":false,"editUrl":"https://github.com/facebook/docusaurus/edit/main/website/docs/api/plugins/plugin-rsdoctor.mdx","tags":[],"version":"current","lastUpdatedBy":"S\xe9bastien Lorber","lastUpdatedAt":1729178406000,"sidebarPosition":7,"frontMatter":{"sidebar_position":7,"slug":"/api/plugins/@docusaurus/plugin-rsdoctor"},"sidebar":"api","previous":{"title":"\uD83D\uDCE6 plugin-google-gtag","permalink":"/docs/api/plugins/@docusaurus/plugin-google-gtag"},"next":{"title":"\uD83D\uDCE6 plugin-google-tag-manager","permalink":"/docs/api/plugins/@docusaurus/plugin-google-tag-manager"}}'),o=n("24246"),a=n("80980"),i=n("15398"),l=n("58636"),u=n("32240");let c={sidebar_position:7,slug:"/api/plugins/@docusaurus/plugin-rsdoctor"},s="\uD83D\uDCE6 plugin-rsdoctor",d={},p=[{value:"Installation",id:"installation",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Example configuration",id:"ex-config",level:3}];function f(e){let r={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,a.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r.header,{children:(0,o.jsx)(r.h1,{id:"-plugin-rsdoctor",children:"\uD83D\uDCE6 plugin-rsdoctor"})}),"\n","\n",(0,o.jsxs)(r.p,{children:["A ",(0,o.jsx)(r.a,{href:"https://rsdoctor.dev/",children:"Rsdoctor"})," plugin can help you troubleshoot the bundling phase of your Docusaurus site, supporting both Webpack and Rspack."]}),"\n",(0,o.jsx)(r.admonition,{type:"tip",children:(0,o.jsx)(r.p,{children:"Use it to figure out which plugin or loader is slowing down the bundler, and focus your efforts on optimizing the bottleneck."})}),"\n",(0,o.jsx)(r.h2,{id:"installation",children:"Installation"}),"\n",(0,o.jsxs)(i.Z,{groupId:"npm2yarn",children:[(0,o.jsx)(l.Z,{value:"npm",children:(0,o.jsx)(r.pre,{children:(0,o.jsx)(r.code,{className:"language-bash",children:"npm install --save @docusaurus/plugin-rsdoctor\n"})})}),(0,o.jsx)(l.Z,{value:"yarn",label:"Yarn",children:(0,o.jsx)(r.pre,{children:(0,o.jsx)(r.code,{className:"language-bash",children:"yarn add @docusaurus/plugin-rsdoctor\n"})})}),(0,o.jsx)(l.Z,{value:"pnpm",label:"pnpm",children:(0,o.jsx)(r.pre,{children:(0,o.jsx)(r.code,{className:"language-bash",children:"pnpm add @docusaurus/plugin-rsdoctor\n"})})})]}),"\n",(0,o.jsx)(r.h2,{id:"configuration",children:"Configuration"}),"\n",(0,o.jsx)(r.p,{children:"Accepted fields:"}),"\n",(0,o.jsx)(u.Z,{children:(0,o.jsxs)(r.table,{children:[(0,o.jsx)(r.thead,{children:(0,o.jsxs)(r.tr,{children:[(0,o.jsx)(r.th,{children:"Name"}),(0,o.jsx)(r.th,{children:"Type"}),(0,o.jsx)(r.th,{children:"Default"}),(0,o.jsx)(r.th,{children:"Description"})]})}),(0,o.jsx)(r.tbody,{children:(0,o.jsxs)(r.tr,{children:[(0,o.jsx)(r.td,{children:(0,o.jsx)(r.code,{children:"rsdoctorOptions"})}),(0,o.jsx)(r.td,{children:(0,o.jsx)(r.code,{children:"object"})}),(0,o.jsx)(r.td,{children:(0,o.jsx)(r.code,{children:"{}"})}),(0,o.jsxs)(r.td,{children:["The ",(0,o.jsx)(r.a,{href:"https://rsdoctor.dev/config/options/options",children:"Rsdoctor bundler plugin options"}),", forwarded as is"]})]})})]})}),"\n",(0,o.jsx)(r.h3,{id:"ex-config",children:"Example configuration"}),"\n",(0,o.jsx)(r.p,{children:"You can configure this plugin through plugin options."}),"\n",(0,o.jsx)(r.pre,{children:(0,o.jsx)(r.code,{className:"language-js",metastring:'title="docusaurus.config.js"',children:"export default {\n plugins: [\n [\n 'rsdoctor',\n {\n rsdoctorOptions: {\n mode: 'lite',\n },\n },\n ],\n ],\n};\n"})})]})}function h(e={}){let{wrapper:r}={...(0,a.a)(),...e.components};return r?(0,o.jsx)(r,{...e,children:(0,o.jsx)(f,{...e})}):f(e)}},58636:function(e,r,n){n.d(r,{Z:()=>i});var t=n("24246");n("27378");var o=n("90496");let a="tabItem_pnkT";function i(e){var r=e.children,n=e.hidden,i=e.className;return(0,t.jsx)("div",{role:"tabpanel",className:(0,o.Z)(a,i),hidden:n,children:r})}},15398:function(e,r,n){n.d(r,{Z:()=>k});var t=n("24246"),o=n("27378"),a=n("90496"),i=n("54947"),l=n("3620"),u=n("844"),c=n("97486"),s=n("32263"),d=n("16971");function p(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=Array(r);n child <".concat("string"==typeof e.type?e.type:e.type.name,'>: all children of the component should be , and every should have a unique "value" prop.'))}))||void 0===r?void 0:r.filter(Boolean))&&void 0!==n?n:[]}function b(e){var r=e.value;return e.tabValues.some(function(e){return e.value===r})}var g=n("71607");let v="tabList_Qoir",m="tabItem_AQgk";function y(e){for(var r=1;r0)throw Error('Docusaurus error: Duplicate values "'.concat(r.map(function(e){return e.value}).join(", "),'" found in . Every value needs to be unique.'))}(e),e},[n,t])),I=f((0,o.useState)(function(){return function(e){var r,n=e.defaultValue,t=e.tabValues;if(0===t.length)throw Error("Docusaurus error: the component requires at least one children component");if(n){if(!b({value:n,tabValues:t}))throw Error('Docusaurus error: The has a defaultValue "'.concat(n,'" but none of its children has the corresponding value. Available values are: ').concat(t.map(function(e){return e.value}).join(", "),". If you intend to show no default tab, use defaultValue={null} instead."));return n}var o=null!==(r=t.find(function(e){return e.default}))&&void 0!==r?r:t[0];if(!o)throw Error("Unexpected error: 0 tabValues");return o.value}({defaultValue:k,tabValues:A})}),2),E=I[0],T=I[1];var D=f((i=(a={queryString:void 0!==S&&S,groupId:P}).queryString,p=a.groupId,g=(0,l.k6)(),v=function(e){var r=e.queryString,n=void 0!==r&&r,t=e.groupId;if("string"==typeof n)return n;if(!1===n)return null;if(!0===n&&!t)throw Error('Docusaurus error: The component groupId prop is required if queryString=true, because this value is used as the search param name. You can also provide an explicit value such as queryString="my-search-param".');return null!=t?t:null}({queryString:void 0!==i&&i,groupId:p}),[(0,c._X)(v),(0,o.useCallback)(function(e){if(!!v){var r,n,t=new URLSearchParams(g.location.search);t.set(v,e),g.replace((r=function(e){for(var r=1;rd});var t=n("24246"),o=n("27378"),a=n("96700"),i=n("3620");let l="apiTable_e8hp";function u(e,r){(null==r||r>e.length)&&(r=e.length);for(var n=0,t=Array(r);n