indooorsman / esbuild-css-modules-plugin

A esbuild plugin to bundle css modules into js(x)/ts(x)
MIT License
91 stars 16 forks source link

Docs for `emitDeclarationFile` #57

Closed bradenhs closed 1 year ago

bradenhs commented 1 year ago

Seems like a great feature! Don't see any docs for it though and am not exactly sure how it works e.g. where does the generated d.ts file end up? So far I haven't been able to make it work.

indooorsman commented 1 year ago

Hi @bradenhs, are u using v3? if so the .d.ts would be generated in the outdir of your esbuild config. source code here: https://github.com/indooorsman/esbuild-css-modules-plugin/blob/5f14f331fd2689dcbbb501800dd15389a53ff94e/index.js#L110

bradenhs commented 1 year ago

Yep was using v3. Took a look at the code though and things didn't seem too complicated so I ended up rolling my own plugin tailored to my use case (not published anywhere - just private to my project). Generating a .d.ts with the plugin is neat idea. Really useful. Thanks!