[{"data":1,"prerenderedAt":213},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Fintegrations\u002Fastro":3},{"id":4,"title":5,"body":6,"description":194,"extension":195,"frontmatter":196,"heading":5,"meta":204,"navigation":206,"order":200,"path":207,"seo":208,"sitemap":209,"source":210,"stem":211,"__hash__":212},"docs\u002Fdocs\u002F5.x\u002Fintegrations\u002Fastro.md","Generate code from your API spec with Astro",{"type":7,"value":8,"toc":187},"minimark",[9,19],[10,11,13,14,18],"blockquote",{"as":12},"important","This integration generates during builds only. Run ",[15,16,17],"code",{},"kubb generate"," before starting the development server.",[20,21,23,28,46,50,65,175],"steps",{"level":22},"2",[24,25,27],"h2",{"id":26},"install-kubb-and-your-output-plugins","Install Kubb and your output plugins",[29,30,31,32,37,38,41,42,45],"p",{},"Follow the ",[33,34,36],"a",{"href":35},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Finstallation","installation guide"," to add Kubb and the plugins your output needs. The integration ships with ",[15,39,40],{},"kubb"," as ",[15,43,44],{},"unplugin-kubb",".",[24,47,49],{"id":48},"configure-the-integration","Configure the integration",[29,51,52,53,56,57,60,61,64],{},"Import your shared ",[15,54,55],{},"kubb.config.ts"," and pass it to the integration. The ",[15,58,59],{},"config"," must be a single object, not the array or function forms ",[15,62,63],{},"defineConfig"," accepts. Run the build command of your tool to generate the files.",[66,67,72],"pre",{"language":68,"filename":69,"code":70,"class":71},"typescript","astro.config.mjs","import { defineConfig } from 'astro\u002Fconfig'\nimport kubb from 'kubb\u002Fastro'\nimport config from '.\u002Fkubb.config'\n\nexport default defineConfig({\n  integrations: [kubb({ config })],\n})","highlights",[15,73,75,102,103,102,115,102,127,102,129,102,143,102,170],{"class":74},"language-typescript",[76,77,80,84,88,92,95,98],"span",{"class":78,"style":79},"line","display: inline",[76,81,83],{"style":82},"color:#d73a49;--hls-dark:#f97583","import ",[76,85,87],{"style":86},"color:#005cc5;--hls-dark:#79b8ff","{ ",[76,89,91],{"style":90},"color:#24292e;--hls-dark:#e1e4e8","defineConfig ",[76,93,94],{"style":86},"} ",[76,96,97],{"style":82},"from ",[76,99,101],{"style":100},"color:#032f62;--hls-dark:#9ecbff","'astro\u002Fconfig'","\n",[76,104,105,107,110,112],{"class":78,"style":79},[76,106,83],{"style":82},[76,108,109],{"style":90},"kubb ",[76,111,97],{"style":82},[76,113,114],{"style":100},"'kubb\u002Fastro'",[76,116,117,119,122,124],{"class":78,"style":79},[76,118,83],{"style":82},[76,120,121],{"style":90},"config ",[76,123,97],{"style":82},[76,125,126],{"style":100},"'.\u002Fkubb.config'",[76,128],{"class":78,"style":79},[76,130,131,134,137,140],{"class":78,"style":79},[76,132,133],{"style":82},"export ",[76,135,136],{"style":82},"default ",[76,138,63],{"style":139},"color:#6f42c1;--hls-dark:#b392f0",[76,141,142],{"style":86},"({",[76,144,145,148,151,154,157,159,162,164,167],{"class":78,"style":79},[76,146,147],{"style":86},"  ",[76,149,150],{"style":86},"integrations",[76,152,153],{"style":82},": ",[76,155,156],{"style":86},"[",[76,158,40],{"style":139},[76,160,161],{"style":86},"({ ",[76,163,121],{"style":90},[76,165,166],{"style":86},"})]",[76,168,169],{"style":82},",",[76,171,172],{"class":78,"style":79},[76,173,174],{"style":86},"})",[10,176,178,179,182,183,45],{"as":177},"note","Bundler integrations apply fewer defaults than the CLI: no Markdown parser, no reporters, and no ",[15,180,181],{},"output.postGenerate"," commands. Use the CLI when you need them. See ",[33,184,186],{"href":185},"\u002Fdocs\u002F5.x\u002Freference\u002Fconfiguration#defaults","Defaults",{"title":188,"searchDepth":189,"depth":189,"links":190},"",5,[191,193],{"id":26,"depth":192,"text":27},2,{"id":48,"depth":192,"text":49},"Add the kubb\u002Fastro integration to astro.config.mjs so every Astro build generates code from your API spec with the plugins in your kubb.config.ts.","md",{"layout":197,"title":5,"description":194,"outline":198,"order":200,"navigation":201},"doc",[192,199],3,14,{"title":202,"icon":203},"Astro","i-simple-icons-astro",{"layout":197,"outline":205},[192,199],{"title":202,"icon":203},"\u002Fdocs\u002F5.x\u002Fintegrations\u002Fastro",{"title":5,"description":194},{"loc":207},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Fintegrations\u002Fastro.md","docs\u002F5.x\u002Fintegrations\u002Fastro","-fhoIzv805HSVAY2k3-GXktmeeSYtu99ZKV-9B89KjE",1792931640820]