[{"data":1,"prerenderedAt":213},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Fintegrations\u002Fvite":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\u002Fvite.md","Generate code from your API spec with Vite",{"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","vite.config.ts","import kubb from 'kubb\u002Fvite'\nimport { defineConfig } from 'vite'\nimport config from '.\u002Fkubb.config'\n\nexport default defineConfig({\n  plugins: [kubb({ config })],\n})","highlights",[15,73,75,95,96,95,115,95,127,95,129,95,143,95,170],{"class":74},"language-typescript",[76,77,80,84,88,91],"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:#24292e;--hls-dark:#e1e4e8","kubb ",[76,89,90],{"style":82},"from ",[76,92,94],{"style":93},"color:#032f62;--hls-dark:#9ecbff","'kubb\u002Fvite'","\n",[76,97,98,100,104,107,110,112],{"class":78,"style":79},[76,99,83],{"style":82},[76,101,103],{"style":102},"color:#005cc5;--hls-dark:#79b8ff","{ ",[76,105,106],{"style":86},"defineConfig ",[76,108,109],{"style":102},"} ",[76,111,90],{"style":82},[76,113,114],{"style":93},"'vite'",[76,116,117,119,122,124],{"class":78,"style":79},[76,118,83],{"style":82},[76,120,121],{"style":86},"config ",[76,123,90],{"style":82},[76,125,126],{"style":93},"'.\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":102},"({",[76,144,145,148,151,154,157,159,162,164,167],{"class":78,"style":79},[76,146,147],{"style":102},"  ",[76,149,150],{"style":102},"plugins",[76,152,153],{"style":82},": ",[76,155,156],{"style":102},"[",[76,158,40],{"style":139},[76,160,161],{"style":102},"({ ",[76,163,121],{"style":86},[76,165,166],{"style":102},"})]",[76,168,169],{"style":82},",",[76,171,172],{"class":78,"style":79},[76,173,174],{"style":102},"})",[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\u002Fvite plugin to vite.config.ts so every Vite 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,6,{"title":202,"icon":203},"Vite","i-simple-icons-vite",{"layout":197,"outline":205},[192,199],{"title":202,"icon":203},"\u002Fdocs\u002F5.x\u002Fintegrations\u002Fvite",{"title":5,"description":194},{"loc":207},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Fintegrations\u002Fvite.md","docs\u002F5.x\u002Fintegrations\u002Fvite","0JZMQf7yjMcLWcyzmBPJRYrIp5ykSjPwP8q7rmYztfI",1792931641952]