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