[{"data":1,"prerenderedAt":504},["ShallowReactive",2],{"navigation_docs":3,"diagnostic-content-VITE0026":48},[4,8,12,16,20,24,28,32,36,40,44],{"title":5,"path":6,"stem":7},"CLI","\u002Fcli","1.cli",{"title":9,"path":10,"stem":11},"Nuxt","\u002Fnuxt","2.nuxt",{"title":13,"path":14,"stem":15},"Vue","\u002Fvue","3.vue",{"title":17,"path":18,"stem":19},"Vite","\u002Fvite","4.vite",{"title":21,"path":22,"stem":23},"Nitro","\u002Fnitro","5.nitro",{"title":25,"path":26,"stem":27},"TypeScript","\u002Ftypescript","6.typescript",{"title":29,"path":30,"stem":31},"shadcn","\u002Fshadcn","7.shadcn",{"title":33,"path":34,"stem":35},"Package","\u002Fpackage","8.package",{"title":37,"path":38,"stem":39},"Extending Doctor","\u002Fextending","9.extending",{"title":41,"path":42,"stem":43},"MCP","\u002Fmcp","9.mcp",{"title":45,"path":46,"stem":47},"Pinia","\u002Fpinia","9.pinia",{"id":49,"title":50,"body":51,"category":57,"code":493,"description":494,"docsUrl":58,"extension":495,"fix":86,"framework":496,"meta":497,"navigation":498,"pack":60,"path":499,"ruleId":61,"rulePath":62,"seo":500,"severity":63,"source":64,"sourceUrl":65,"stem":501,"why":502,"__hash__":503},"diagnostics\u002Fdiagnostics\u002FVITE0026.md","VITE0026: Return only new array entries from Vite config hooks",{"type":52,"value":53,"toc":483},"minimark",[54,66,71,80,84,87,91,96,99,278,281,414,418,421,451,455,467,471,479],[55,56],"rule-metadata",{"category":57,"docsUrl":58,"fix":59,"pack":60,"ruleId":61,"rulePath":62,"severity":63,"source":64,"sourceUrl":65},"plugins","https:\u002F\u002Fvite.dev\u002Fguide\u002Fapi-plugin.html#config","no","vite-doctor\u002Fvite","vite\u002Fplugin\u002Fno-config-hook-array-echo","\u002Fvite\u002Frules\u002Fplugin\u002Fno-config-hook-array-echo","warn","src\u002Frule-packs\u002Fvite\u002Frules\u002Fplugin-config.ts","https:\u002F\u002Fgithub.com\u002Fonmax\u002Fvite-doctor\u002Fblob\u002Fmain\u002Fsrc\u002Frule-packs\u002Fvite\u002Frules\u002Fplugin-config.ts",[67,68,70],"h2",{"id":69},"why-it-happens","Why it happens",[72,73,74,75,79],"p",{},"Vite merges each config and configEnvironment hook result into the current config with mergeConfig, which concatenates arrays instead of replacing them. A hook that returns ",[76,77,78],"span",{},"...config.ssr.noExternal, 'my-package'"," therefore adds every existing entry a second time, and each plugin that does this doubles the entries of the plugins before it. Doctor reports a returned array at a config path that spreads or concatenates the incoming value at the same path, directly or through a helper function defined once in the same file that returns its parameter spread or concatenated. It does not follow helpers imported from other files, and it ignores hooks that assign to the incoming config in place. An object counts as a plugin when it has Vite plugin hooks such as configResolved or enforce, or when it has a name and the file imports or requires Vite, Vitest, Rollup, Rolldown, unplugin, or @nuxt\u002Fkit, or is a Vite config.",[67,81,83],{"id":82},"fix","Fix",[72,85,86],{},"Return only the entries the plugin adds, skipping entries that are already present, or assign to the incoming config in place and leave that field out of the returned object.",[67,88,90],{"id":89},"example","Example",[92,93,95],"h3",{"id":94},"return-only-the-added-entries","Return only the added entries",[72,97,98],{},"Before",[100,101,106],"pre",{"className":102,"code":103,"language":104,"meta":105,"style":105},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export function dedupePlugin(): Plugin {\n  return {\n    name: 'dedupe-vue',\n    config(config) {\n      return {\n        resolve: { dedupe: [...(config.resolve?.dedupe ?? []), 'vue'] },\n      }\n    },\n  }\n}\n","ts","",[107,108,109,136,144,167,185,193,254,260,266,272],"code",{"__ignoreMap":105},[76,110,113,117,121,125,129,133],{"class":111,"line":112},"line",1,[76,114,116],{"class":115},"s7zQu","export",[76,118,120],{"class":119},"spNyl"," function",[76,122,124],{"class":123},"s2Zo4"," dedupePlugin",[76,126,128],{"class":127},"sMK4o","():",[76,130,132],{"class":131},"sBMFI"," Plugin",[76,134,135],{"class":127}," {\n",[76,137,139,142],{"class":111,"line":138},2,[76,140,141],{"class":115},"  return",[76,143,135],{"class":127},[76,145,147,151,154,157,161,164],{"class":111,"line":146},3,[76,148,150],{"class":149},"swJcz","    name",[76,152,153],{"class":127},":",[76,155,156],{"class":127}," '",[76,158,160],{"class":159},"sfazB","dedupe-vue",[76,162,163],{"class":127},"'",[76,165,166],{"class":127},",\n",[76,168,170,173,176,180,183],{"class":111,"line":169},4,[76,171,172],{"class":149},"    config",[76,174,175],{"class":127},"(",[76,177,179],{"class":178},"sHdIc","config",[76,181,182],{"class":127},")",[76,184,135],{"class":127},[76,186,188,191],{"class":111,"line":187},5,[76,189,190],{"class":115},"      return",[76,192,135],{"class":127},[76,194,196,199,201,204,207,209,212,215,217,220,223,226,229,232,235,238,241,243,246,248,251],{"class":111,"line":195},6,[76,197,198],{"class":149},"        resolve",[76,200,153],{"class":127},[76,202,203],{"class":127}," {",[76,205,206],{"class":149}," dedupe",[76,208,153],{"class":127},[76,210,211],{"class":149}," [",[76,213,214],{"class":127},"...",[76,216,175],{"class":149},[76,218,179],{"class":219},"sTEyZ",[76,221,222],{"class":127},".",[76,224,225],{"class":219},"resolve",[76,227,228],{"class":127},"?.",[76,230,231],{"class":219},"dedupe",[76,233,234],{"class":127}," ??",[76,236,237],{"class":149}," [])",[76,239,240],{"class":127},",",[76,242,156],{"class":127},[76,244,245],{"class":159},"vue",[76,247,163],{"class":127},[76,249,250],{"class":149},"] ",[76,252,253],{"class":127},"},\n",[76,255,257],{"class":111,"line":256},7,[76,258,259],{"class":127},"      }\n",[76,261,263],{"class":111,"line":262},8,[76,264,265],{"class":127},"    },\n",[76,267,269],{"class":111,"line":268},9,[76,270,271],{"class":127},"  }\n",[76,273,275],{"class":111,"line":274},10,[76,276,277],{"class":127},"}\n",[72,279,280],{},"After",[100,282,284],{"className":102,"code":283,"language":104,"meta":105,"style":105},"export function dedupePlugin(): Plugin {\n  return {\n    name: 'dedupe-vue',\n    config(config) {\n      if (config.resolve?.dedupe?.includes('vue')) return\n      return { resolve: { dedupe: ['vue'] } }\n    },\n  }\n}\n",[107,285,286,300,306,320,332,369,402,406,410],{"__ignoreMap":105},[76,287,288,290,292,294,296,298],{"class":111,"line":112},[76,289,116],{"class":115},[76,291,120],{"class":119},[76,293,124],{"class":123},[76,295,128],{"class":127},[76,297,132],{"class":131},[76,299,135],{"class":127},[76,301,302,304],{"class":111,"line":138},[76,303,141],{"class":115},[76,305,135],{"class":127},[76,307,308,310,312,314,316,318],{"class":111,"line":146},[76,309,150],{"class":149},[76,311,153],{"class":127},[76,313,156],{"class":127},[76,315,160],{"class":159},[76,317,163],{"class":127},[76,319,166],{"class":127},[76,321,322,324,326,328,330],{"class":111,"line":169},[76,323,172],{"class":149},[76,325,175],{"class":127},[76,327,179],{"class":178},[76,329,182],{"class":127},[76,331,135],{"class":127},[76,333,334,337,340,342,344,346,348,350,352,355,357,359,361,363,366],{"class":111,"line":187},[76,335,336],{"class":115},"      if",[76,338,339],{"class":149}," (",[76,341,179],{"class":219},[76,343,222],{"class":127},[76,345,225],{"class":219},[76,347,228],{"class":127},[76,349,231],{"class":219},[76,351,228],{"class":127},[76,353,354],{"class":123},"includes",[76,356,175],{"class":149},[76,358,163],{"class":127},[76,360,245],{"class":159},[76,362,163],{"class":127},[76,364,365],{"class":149},")) ",[76,367,368],{"class":115},"return\n",[76,370,371,373,375,378,380,382,384,386,388,390,392,394,396,399],{"class":111,"line":195},[76,372,190],{"class":115},[76,374,203],{"class":127},[76,376,377],{"class":149}," resolve",[76,379,153],{"class":127},[76,381,203],{"class":127},[76,383,206],{"class":149},[76,385,153],{"class":127},[76,387,211],{"class":149},[76,389,163],{"class":127},[76,391,245],{"class":159},[76,393,163],{"class":127},[76,395,250],{"class":149},[76,397,398],{"class":127},"}",[76,400,401],{"class":127}," }\n",[76,403,404],{"class":111,"line":256},[76,405,265],{"class":127},[76,407,408],{"class":111,"line":262},[76,409,271],{"class":127},[76,411,412],{"class":111,"line":268},[76,413,277],{"class":127},[67,415,417],{"id":416},"verify-the-fix","Verify the fix",[72,419,420],{},"Run only this rule after editing so the report stays focused on the diagnostic you are closing:",[100,422,426],{"className":423,"code":424,"language":425,"meta":105,"style":105},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm vite-doctor . --framework vite --rules vite\u002Fplugin\u002Fno-config-hook-array-echo\n","bash",[107,427,428],{"__ignoreMap":105},[76,429,430,433,436,439,442,445,448],{"class":111,"line":112},[76,431,432],{"class":131},"pnpm",[76,434,435],{"class":159}," vite-doctor",[76,437,438],{"class":159}," .",[76,440,441],{"class":159}," --framework",[76,443,444],{"class":159}," vite",[76,446,447],{"class":159}," --rules",[76,449,450],{"class":159}," vite\u002Fplugin\u002Fno-config-hook-array-echo\n",[67,452,454],{"id":453},"useful-links","Useful links",[456,457,458],"ul",{},[459,460,461],"li",{},[462,463,466],"a",{"href":58,"rel":464},[465],"nofollow","Upstream docs",[67,468,470],{"id":469},"related-rule","Related rule",[456,472,473],{},[459,474,475],{},[462,476,477],{"href":62},[107,478,61],{},[480,481,482],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":105,"searchDepth":138,"depth":138,"links":484},[485,486,487,490,491,492],{"id":69,"depth":138,"text":70},{"id":82,"depth":138,"text":83},{"id":89,"depth":138,"text":90,"children":488},[489],{"id":94,"depth":146,"text":95},{"id":416,"depth":138,"text":417},{"id":453,"depth":138,"text":454},{"id":469,"depth":138,"text":470},"VITE0026","Reports Vite config and configEnvironment hooks that return arrays containing the incoming config's entries.","md","vite",{},true,"\u002Fdiagnostics\u002Fvite0026",{"title":50,"description":494},"diagnostics\u002FVITE0026","Vite merges each config and configEnvironment hook result into the current config with mergeConfig, which concatenates arrays instead of replacing them. A hook that returns [...config.ssr.noExternal, 'my-package'] therefore adds every existing entry a second time, and each plugin that does this doubles the entries of the plugins before it. Doctor reports a returned array at a config path that spreads or concatenates the incoming value at the same path, directly or through a helper function defined once in the same file that returns its parameter spread or concatenated. It does not follow helpers imported from other files, and it ignores hooks that assign to the incoming config in place. An object counts as a plugin when it has Vite plugin hooks such as configResolved or enforce, or when it has a name and the file imports or requires Vite, Vitest, Rollup, Rolldown, unplugin, or @nuxt\u002Fkit, or is a Vite config.","e2uB490lxdVu4LhK8YBnO8MmI6soPmi2-sLr9Bi0XS0",1795268814197]