haxiomic / dts2hx

Converts TypeScript definition files (d.ts) to haxe externs (.hx) via the TypeScript compiler API
MIT License
135 stars 9 forks source link

How can I use it locally ? #127

Open FlashTang opened 10 months ago

FlashTang commented 10 months ago

Hi I just converted svgjs.d.ts successfully but the generated extern use require So I can't use it directly, I have to write untyped Browser.window["svgdotjs_svg_$js_svgdotjs_SvgJs"] = untyped SVG; and then delete require from output js to be able to run on the browser locally like so :

Screen Shot 2024-01-14 at 02 38 15 Screen Shot 2024-01-14 at 02 38 30

My question is how to config the dts2hx so it can be used locally

FlashTang commented 10 months ago

I just converted js with esbuild , it found svg.esm.js from node_modules then packed it in the bundle, seems it works