[{"data":1,"prerenderedAt":278},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Fintegrations\u002Fbuild-tools\u002Frollup":3},{"id":4,"title":5,"body":6,"description":258,"extension":259,"frontmatter":260,"heading":268,"meta":269,"navigation":271,"order":264,"path":272,"seo":273,"sitemap":274,"source":275,"stem":276,"__hash__":277},"docs\u002Fdocs\u002F5.x\u002Fintegrations\u002Fbuild-tools\u002Frollup.md","Rollup plugin - Generate code from OpenAPI",{"type":7,"value":8,"toc":249},"minimark",[9,25,242],[10,11,12,16,17,20,21,24],"p",{},[13,14,15],"code",{},"kubb\u002Frollup"," generates code from your ",[13,18,19],{},"kubb.config.ts"," once, before the Rollup build continues. It ships with ",[13,22,23],{},"kubb",".",[26,27,29,34,62,68,78,199,217,221],"steps",{"level":28},"2",[30,31,33],"h2",{"id":32},"install-kubb-and-your-plugins","Install Kubb and your plugins",[10,35,36,37,42,43,46,47,50,51,54,55,58,59,24],{},"Follow ",[38,39,41],"a",{"href":40},"\u002Fdocs\u002F5.x\u002Fintroduction\u002Finstallation","Installation",". Add ",[13,44,45],{},"@rollup\u002Fplugin-typescript",", ",[13,48,49],{},"tslib",", and ",[13,52,53],{},"typescript"," to your dev dependencies, so Rollup can compile ",[13,56,57],{},"src\u002Findex.ts"," and ",[13,60,61],{},"rollup.config.ts",[30,63,65,66],{"id":64},"add-kubb-to-rollupconfigts","Add Kubb to ",[13,67,61],{},[10,69,70,71,73,74,77],{},"Pass one config object from your ",[13,72,19],{}," as ",[13,75,76],{},"config",", not an array or a function.",[79,80,83],"pre",{"language":53,"filename":61,"code":81,"class":82},"import typescript from '@rollup\u002Fplugin-typescript'\nimport kubb from 'kubb\u002Frollup'\nimport config from '.\u002Fkubb.config.ts'\n\nexport default {\n  input: 'src\u002Findex.ts',\n  plugins: [kubb({ config }), typescript()],\n}","highlights",[13,84,86,106,107,106,119,106,131,106,133,106,145,106,162,106,194],{"class":85},"language-typescript",[87,88,91,95,99,102],"span",{"class":89,"style":90},"line","display: inline",[87,92,94],{"style":93},"color:#d73a49;--hls-dark:#f97583","import ",[87,96,98],{"style":97},"color:#24292e;--hls-dark:#e1e4e8","typescript ",[87,100,101],{"style":93},"from ",[87,103,105],{"style":104},"color:#032f62;--hls-dark:#9ecbff","'@rollup\u002Fplugin-typescript'","\n",[87,108,109,111,114,116],{"class":89,"style":90},[87,110,94],{"style":93},[87,112,113],{"style":97},"kubb ",[87,115,101],{"style":93},[87,117,118],{"style":104},"'kubb\u002Frollup'",[87,120,121,123,126,128],{"class":89,"style":90},[87,122,94],{"style":93},[87,124,125],{"style":97},"config ",[87,127,101],{"style":93},[87,129,130],{"style":104},"'.\u002Fkubb.config.ts'",[87,132],{"class":89,"style":90},[87,134,135,138,141],{"class":89,"style":90},[87,136,137],{"style":93},"export ",[87,139,140],{"style":93},"default ",[87,142,144],{"style":143},"color:#005cc5;--hls-dark:#79b8ff","{",[87,146,147,150,153,156,159],{"class":89,"style":90},[87,148,149],{"style":143},"  ",[87,151,152],{"style":143},"input",[87,154,155],{"style":93},": ",[87,157,158],{"style":104},"'src\u002Findex.ts'",[87,160,161],{"style":93},",",[87,163,164,166,169,171,174,177,180,182,185,187,189,192],{"class":89,"style":90},[87,165,149],{"style":93},[87,167,168],{"style":143},"plugins",[87,170,155],{"style":93},[87,172,173],{"style":143},"[",[87,175,23],{"style":176},"color:#6f42c1;--hls-dark:#b392f0",[87,178,179],{"style":143},"({ ",[87,181,125],{"style":97},[87,183,184],{"style":143},"})",[87,186,46],{"style":93},[87,188,53],{"style":176},[87,190,191],{"style":143},"()]",[87,193,161],{"style":93},[87,195,196],{"class":89,"style":90},[87,197,198],{"style":143},"}",[10,200,201,202,204,205,208,209,212,213,216],{},"Add ",[13,203,61],{}," to the ",[13,206,207],{},"include"," of ",[13,210,211],{},"tsconfig.json",", such as ",[13,214,215],{},"\"include\": [\"src\u002F**\u002F*\", \"rollup.config.ts\"]",", so the TypeScript plugin can compile it.",[30,218,220],{"id":219},"run-the-build","Run the build",[10,222,223,224,227,228,46,231,50,234,237,238,241],{},"Run ",[13,225,226],{},"rollup -c rollup.config.ts --configPlugin typescript",". Rollup loads only ",[13,229,230],{},".js",[13,232,233],{},".mjs",[13,235,236],{},".cjs"," config files by default, so ",[13,239,240],{},"--configPlugin typescript"," compiles the config first. If Kubb fails, the build fails.",[10,243,244,248],{},[38,245,247],{"href":246},"\u002Fdocs\u002F5.x\u002Fintegrations\u002Fbuild-tools#how-the-build-runs-kubb","How the build runs Kubb"," covers defaults, reports, and watch rebuilds.",{"title":250,"searchDepth":251,"depth":251,"links":252},"",5,[253,255,257],{"id":32,"depth":254,"text":33},2,{"id":64,"depth":254,"text":256},"Add Kubb to rollup.config.ts",{"id":219,"depth":254,"text":220},"Add the kubb\u002Frollup plugin to rollup.config.ts so every Rollup build generates code from your API spec with the plugins in your kubb.config.ts.","md",{"layout":261,"title":5,"description":258,"outline":262,"order":264,"navigation":265},"doc",[254,263],3,8,{"title":266,"icon":267},"Rollup","i-simple-icons-rollupdotjs","Generate code from your API spec with Rollup",{"layout":261,"outline":270},[254,263],{"title":266,"icon":267},"\u002Fdocs\u002F5.x\u002Fintegrations\u002Fbuild-tools\u002Frollup",{"title":5,"description":258},{"loc":272},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Fintegrations\u002Fbuild-tools\u002Frollup.md","docs\u002F5.x\u002Fintegrations\u002Fbuild-tools\u002Frollup","pGqBTvrckIsC-3gWYSaca7BDh--176LrWrPTRTBsoVs",1795021322925]