[{"data":1,"prerenderedAt":264},["ShallowReactive",2],{"page:\u002Fextensions\u002Fkubb-labs\u002Fparser-ts\u002Foptions":3},{"id":4,"frontmatter":5,"title":6,"heading":6,"body":7,"path":263,"source":4},"extensions\u002Fkubb-labs\u002Fparser-ts\u002Foptions.md",{},"Options",{"type":8,"value":9,"toc":253},"minimark",[10,26,31,80,84,87,99,125,142,182],[11,12,13,17,18,21,22,25],"p",{},[14,15,16],"code",{},"parserTs"," and ",[14,19,20],{},"parserTsx"," accept the same single option, ",[14,23,24],{},"extension",", which rewrites the import and export extensions the TypeScript parser emits.",[27,28,30],"h2",{"id":29},"options-overview","Options overview",[32,33,34,50],"table",{},[35,36,37],"thead",{},[38,39,40,44,47],"tr",{},[41,42,43],"th",{},"Option",[41,45,46],{},"Purpose",[41,48,49],{},"Default",[51,52,53],"tbody",{},[38,54,55,64,75],{},[56,57,58],"td",{},[59,60,62],"a",{"href":61},"#extension",[14,63,24],{},[56,65,66,67,70,71,74],{},"Rewrite the extensions emitted in ",[14,68,69],{},"import","\u002F",[14,72,73],{},"export"," statements.",[56,76,77],{},[14,78,79],{},"{ '.ts': '' }",[27,81,83],{"id":82},"option-details","Option details",[85,86,24],"h3",{"id":24},[11,88,89,90,70,92,94,95,98],{},"Rewrites the extensions emitted in relative ",[14,91,69],{},[14,93,73],{}," statements. Each key is the extension of a generated file, and its value is the extension written on the relative specifiers in that file. ",[14,96,97],{},"''"," drops it, and so does a generated file whose extension has no key. Package specifiers and the on-disk filenames never change.",[11,100,101,102,105,106,109,110,113,114,117,118,120,121,124],{},"Use ",[14,103,104],{},"{ '.ts': '.js' }"," to emit ",[14,107,108],{},".js"," specifiers for ESM output compiled to JavaScript. Use ",[14,111,112],{},"{ '.ts': '.ts' }"," to keep ",[14,115,116],{},".ts"," specifiers when you run the ",[14,119,116],{}," files directly in Node.js or compile them with ",[14,122,123],{},"rewriteRelativeImportExtensions",".",[11,126,127,128,131,132,135,136,17,138,141],{},"The same mapping applies to runtime templates a plugin copies into the output, such as the ",[14,129,130],{},".kubb\u002F"," runtime files of ",[14,133,134],{},"@kubb\u002Fplugin-fetch",". Their top-level ",[14,137,69],{},[14,139,140],{},"export … from"," statements become import and export nodes, so the whole output follows one convention.",[32,143,144,152],{},[35,145,146],{},[38,147,148,150],{},[41,149],{},[41,151],{},[51,153,154,164,174],{},[38,155,156,159],{},[56,157,158],{},"Type",[56,160,161],{},[14,162,163],{},"Record\u003Cstring, string>",[38,165,166,169],{},[56,167,168],{},"Required",[56,170,171],{},[14,172,173],{},"false",[38,175,176,178],{},[56,177,49],{},[56,179,180],{},[14,181,79],{},[183,184,188],"pre",{"language":185,"code":186,"class":187},"typescript","parserTs({ extension: { '.ts': '.js' } }) \u002F\u002F import '.\u002Fapi.js' instead of '.\u002Fapi'\nparserTs({ extension: { '.ts': '.ts' } }) \u002F\u002F import '.\u002Fapi.ts' instead of '.\u002Fapi'","highlights",[14,189,191,228,229],{"class":190},"language-typescript",[192,193,196,199,203,205,209,212,216,218,221,224],"span",{"class":194,"style":195},"line","display: inline",[192,197,16],{"style":198},"color:#6f42c1;--hls-dark:#b392f0",[192,200,202],{"style":201},"color:#005cc5;--hls-dark:#79b8ff","({ ",[192,204,24],{"style":201},[192,206,208],{"style":207},"color:#d73a49;--hls-dark:#f97583",": ",[192,210,211],{"style":201},"{ ",[192,213,215],{"style":214},"color:#032f62;--hls-dark:#9ecbff","'.ts'",[192,217,208],{"style":207},[192,219,220],{"style":214},"'.js' ",[192,222,223],{"style":201},"} }) ",[192,225,227],{"style":226},"color:#6a737d;--hls-dark:#6a737d","\u002F\u002F import '.\u002Fapi.js' instead of '.\u002Fapi'","\n",[192,230,231,233,235,237,239,241,243,245,248,250],{"class":194,"style":195},[192,232,16],{"style":198},[192,234,202],{"style":201},[192,236,24],{"style":201},[192,238,208],{"style":207},[192,240,211],{"style":201},[192,242,215],{"style":214},[192,244,208],{"style":207},[192,246,247],{"style":214},"'.ts' ",[192,249,223],{"style":201},[192,251,252],{"style":226},"\u002F\u002F import '.\u002Fapi.ts' instead of '.\u002Fapi'",{"title":254,"searchDepth":255,"depth":255,"links":256},"",5,[257,259],{"id":29,"depth":258,"text":30},2,{"id":82,"depth":258,"text":83,"children":260},[261],{"id":24,"depth":262,"text":24},3,"\u002Fextensions\u002Fkubb-labs\u002Fparser-ts\u002Foptions",1793639044206]