[{"data":1,"prerenderedAt":511},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Fhow-to\u002Fbarrel-files":3},{"id":4,"title":5,"body":6,"description":495,"extension":496,"frontmatter":497,"heading":5,"meta":503,"navigation":504,"order":500,"path":505,"seo":506,"sitemap":507,"source":508,"stem":509,"__hash__":510},"docs\u002Fdocs\u002F5.x\u002Fhow-to\u002Fbarrel-files.md","Add barrel files",{"type":7,"value":8,"toc":488},"minimark",[9,38,44,47,52,86,239,243,270],[10,11,12,13,17,18,25,26,29,30,33,34,37],"p",{},"A barrel file is an ",[14,15,16],"code",{},"index.ts"," that re-exports everything in a directory, so consumers import from one place. ",[19,20,22],"a",{"href":21},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-barrel",[14,23,24],{},"@kubb\u002Fplugin-barrel"," ships inside ",[14,27,28],{},"kubb"," and ",[14,31,32],{},"defineConfig"," registers it for you. It generates nothing until you set ",[14,35,36],{},"output.barrel",".",[10,39,40,41,43],{},"Toggle the export style and barrel depth to see what each ",[14,42,16],{}," re-exports.",[45,46],"barrel-tree",{},[48,49,51],"h2",{"id":50},"enable-the-root-barrel","Enable the root barrel",[10,53,54,55,57,58,60,61,63,64,67,68,71,72,75,76,79,80,85],{},"Set ",[14,56,36],{}," on ",[14,59,32],{},". It controls the root ",[14,62,16],{}," and the default every plugin inherits. ",[14,65,66],{},"type"," is ",[14,69,70],{},"'named'"," for per-symbol re-exports or ",[14,73,74],{},"'all'"," for ",[14,77,78],{},"export *",". See ",[19,81,83],{"href":82},"\u002Fextensions\u002Fkubb-labs\u002Fplugin-barrel\u002Foptions#type",[14,84,66],{}," for the difference.",[87,88,93],"pre",{"language":89,"filename":90,"code":91,"class":92},"typescript","kubb.config.ts","import { defineConfig } from 'kubb\u002Fconfig'\nimport { pluginTs } from '@kubb\u002Fplugin-ts'\n\nexport default defineConfig({\n  input: '.\u002FpetStore.yaml',\n  output: { path: '.\u002Fsrc\u002Fgen', barrel: { type: 'named' } },\n  plugins: [pluginTs()],\n})","highlights",[14,94,96,123,124,123,140,123,142,123,156,123,173,123,214,123,234],{"class":95},"language-typescript",[97,98,101,105,109,113,116,119],"span",{"class":99,"style":100},"line","display: inline",[97,102,104],{"style":103},"color:#d73a49;--hls-dark:#f97583","import ",[97,106,108],{"style":107},"color:#005cc5;--hls-dark:#79b8ff","{ ",[97,110,112],{"style":111},"color:#24292e;--hls-dark:#e1e4e8","defineConfig ",[97,114,115],{"style":107},"} ",[97,117,118],{"style":103},"from ",[97,120,122],{"style":121},"color:#032f62;--hls-dark:#9ecbff","'kubb\u002Fconfig'","\n",[97,125,126,128,130,133,135,137],{"class":99,"style":100},[97,127,104],{"style":103},[97,129,108],{"style":107},[97,131,132],{"style":111},"pluginTs ",[97,134,115],{"style":107},[97,136,118],{"style":103},[97,138,139],{"style":121},"'@kubb\u002Fplugin-ts'",[97,141],{"class":99,"style":100},[97,143,144,147,150,153],{"class":99,"style":100},[97,145,146],{"style":103},"export ",[97,148,149],{"style":103},"default ",[97,151,32],{"style":152},"color:#6f42c1;--hls-dark:#b392f0",[97,154,155],{"style":107},"({",[97,157,158,161,164,167,170],{"class":99,"style":100},[97,159,160],{"style":107},"  ",[97,162,163],{"style":107},"input",[97,165,166],{"style":103},": ",[97,168,169],{"style":121},"'.\u002FpetStore.yaml'",[97,171,172],{"style":103},",",[97,174,175,177,180,182,184,187,189,192,195,198,200,202,204,206,209,212],{"class":99,"style":100},[97,176,160],{"style":103},[97,178,179],{"style":107},"output",[97,181,166],{"style":103},[97,183,108],{"style":107},[97,185,186],{"style":107},"path",[97,188,166],{"style":103},[97,190,191],{"style":121},"'.\u002Fsrc\u002Fgen'",[97,193,194],{"style":103},", ",[97,196,197],{"style":107},"barrel",[97,199,166],{"style":103},[97,201,108],{"style":107},[97,203,66],{"style":107},[97,205,166],{"style":103},[97,207,208],{"style":121},"'named' ",[97,210,211],{"style":107},"} }",[97,213,172],{"style":103},[97,215,216,218,221,223,226,229,232],{"class":99,"style":100},[97,217,160],{"style":103},[97,219,220],{"style":107},"plugins",[97,222,166],{"style":103},[97,224,225],{"style":107},"[",[97,227,228],{"style":152},"pluginTs",[97,230,231],{"style":107},"()]",[97,233,172],{"style":103},[97,235,236],{"class":99,"style":100},[97,237,238],{"style":107},"})",[48,240,242],{"id":241},"adjust-a-single-plugin","Adjust a single plugin",[10,244,54,245,247,248,250,251,254,255,257,258,261,262,265,266,269],{},[14,246,197],{}," inside a plugin's ",[14,249,179],{}," to change or drop that plugin's barrel. ",[14,252,253],{},"nested: true"," writes an ",[14,256,16],{}," in every subdirectory instead of one flat barrel. ",[14,259,260],{},"false"," skips the plugin's barrel and drops its files from the root barrel. A plugin only gets a barrel in ",[14,263,264],{},"output.mode: 'directory'",", the mode an extensionless ",[14,267,268],{},"output.path"," implies.",[87,271,273],{"language":89,"filename":90,"code":272,"class":92},"import { defineConfig } from 'kubb\u002Fconfig'\nimport { pluginTs } from '@kubb\u002Fplugin-ts'\nimport { pluginZod } from '@kubb\u002Fplugin-zod'\n\nexport default defineConfig({\n  input: '.\u002FpetStore.yaml',\n  output: { path: '.\u002Fsrc\u002Fgen', barrel: { type: 'named' } },\n  plugins: [\n    pluginTs({ output: { path: 'types', barrel: { type: 'all', nested: true } } }),\n    pluginZod({ output: { path: 'zod', barrel: false } }),\n  ],\n})",[14,274,275,123,289,123,303,123,319,123,321,123,331,123,343,123,377,123,387,123,439,123,475,123,484],{"class":95},[97,276,277,279,281,283,285,287],{"class":99,"style":100},[97,278,104],{"style":103},[97,280,108],{"style":107},[97,282,112],{"style":111},[97,284,115],{"style":107},[97,286,118],{"style":103},[97,288,122],{"style":121},[97,290,291,293,295,297,299,301],{"class":99,"style":100},[97,292,104],{"style":103},[97,294,108],{"style":107},[97,296,132],{"style":111},[97,298,115],{"style":107},[97,300,118],{"style":103},[97,302,139],{"style":121},[97,304,305,307,309,312,314,316],{"class":99,"style":100},[97,306,104],{"style":103},[97,308,108],{"style":107},[97,310,311],{"style":111},"pluginZod ",[97,313,115],{"style":107},[97,315,118],{"style":103},[97,317,318],{"style":121},"'@kubb\u002Fplugin-zod'",[97,320],{"class":99,"style":100},[97,322,323,325,327,329],{"class":99,"style":100},[97,324,146],{"style":103},[97,326,149],{"style":103},[97,328,32],{"style":152},[97,330,155],{"style":107},[97,332,333,335,337,339,341],{"class":99,"style":100},[97,334,160],{"style":107},[97,336,163],{"style":107},[97,338,166],{"style":103},[97,340,169],{"style":121},[97,342,172],{"style":103},[97,344,345,347,349,351,353,355,357,359,361,363,365,367,369,371,373,375],{"class":99,"style":100},[97,346,160],{"style":103},[97,348,179],{"style":107},[97,350,166],{"style":103},[97,352,108],{"style":107},[97,354,186],{"style":107},[97,356,166],{"style":103},[97,358,191],{"style":121},[97,360,194],{"style":103},[97,362,197],{"style":107},[97,364,166],{"style":103},[97,366,108],{"style":107},[97,368,66],{"style":107},[97,370,166],{"style":103},[97,372,208],{"style":121},[97,374,211],{"style":107},[97,376,172],{"style":103},[97,378,379,381,383,385],{"class":99,"style":100},[97,380,160],{"style":103},[97,382,220],{"style":107},[97,384,166],{"style":103},[97,386,225],{"style":107},[97,388,389,392,394,397,399,401,403,405,407,410,412,414,416,418,420,422,424,426,429,431,434,437],{"class":99,"style":100},[97,390,391],{"style":107},"    ",[97,393,228],{"style":152},[97,395,396],{"style":107},"({ ",[97,398,179],{"style":107},[97,400,166],{"style":103},[97,402,108],{"style":107},[97,404,186],{"style":107},[97,406,166],{"style":103},[97,408,409],{"style":121},"'types'",[97,411,194],{"style":103},[97,413,197],{"style":107},[97,415,166],{"style":103},[97,417,108],{"style":107},[97,419,66],{"style":107},[97,421,166],{"style":103},[97,423,74],{"style":121},[97,425,194],{"style":103},[97,427,428],{"style":107},"nested",[97,430,166],{"style":103},[97,432,433],{"style":107},"true ",[97,435,436],{"style":107},"} } })",[97,438,172],{"style":103},[97,440,441,443,446,448,450,452,454,456,458,461,463,465,467,470,473],{"class":99,"style":100},[97,442,391],{"style":103},[97,444,445],{"style":152},"pluginZod",[97,447,396],{"style":107},[97,449,179],{"style":107},[97,451,166],{"style":103},[97,453,108],{"style":107},[97,455,186],{"style":107},[97,457,166],{"style":103},[97,459,460],{"style":121},"'zod'",[97,462,194],{"style":103},[97,464,197],{"style":107},[97,466,166],{"style":103},[97,468,469],{"style":107},"false ",[97,471,472],{"style":107},"} })",[97,474,172],{"style":103},[97,476,477,479,482],{"class":99,"style":100},[97,478,160],{"style":103},[97,480,481],{"style":107},"]",[97,483,172],{"style":103},[97,485,486],{"class":99,"style":100},[97,487,238],{"style":107},{"title":489,"searchDepth":490,"depth":490,"links":491},"",5,[492,494],{"id":50,"depth":493,"text":51},2,{"id":241,"depth":493,"text":242},"Generate index.ts barrel files for the output directory and for individual plugins with @kubb\u002Fplugin-barrel.","md",{"layout":498,"title":5,"description":495,"outline":499,"order":500,"navigation":501},"doc","deep",6,{"title":5,"icon":502},"i-iconoir-packages",{"layout":498,"outline":499},{"title":5,"icon":502},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Fbarrel-files",{"title":5,"description":495},{"loc":505},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Fhow-to\u002Fbarrel-files.md","docs\u002F5.x\u002Fhow-to\u002Fbarrel-files","eONVS8x-sjaW7oO-DsGxPOJGmXz5YE6eZCVvc4fCOaw",1792931639918]