tree-shaker icon indicating copy to clipboard operation
tree-shaker copied to clipboard

Using as a Rust library

Open ErenayDev opened this issue 8 months ago • 2 comments

Hi. thanks for making this awesome tool !

I wanna use jsshaker in my Rust project but there's no way to add it as a dependency since it's not published on crates.io.

Looking at lib.rs, the API is already there with tree_shake() function and proper types. Would you consider publishing it to crates.io?

This would let Rust users use it directly in their Rust toolchains

Also by this way, Rust users can install via cargo install jsshaker without npm (I didn't check the whole codebase but probably it'll work)

ErenayDev avatar Mar 10 '26 11:03 ErenayDev

Thank you for bringing this up. The main problem right now is that due to various bugs, the optimizer gets stuck or produces incorrect results for much of the large code, making publishing the packages not quite useful. If you need to use it as a Rust package, you can directly use this GitHub repository as the package source at the moment.

kermanx avatar Mar 11 '26 06:03 kermanx

Yeah I know it. I said that because some minor changes in main branch could mess things up

ErenayDev avatar Mar 11 '26 11:03 ErenayDev