Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can I kick it off programmatically inside a Cargo build via build.rs? I tried to go down this road with SWC and ... failed.

To be clear: I have JS/HTML artifacts in my repo alongside Rust source. I want to bundle them then ship them inside a produced Rust binary, or at least with it. With one build step using Cargo.



I was looking if it provided a Rust crate as a lib, similar to how esbuild is just a Go lib (if you want to use it like that) but no luck.


Found the same thing with swc. They have all this tooling, written in Rust, but no way to invoke it as a lib so it could be used inside a Cargo build.rs. Not easily at least. I made some progress then gave up.



Well yes I'm using something familiar, to embed the HTML and JS directly. But want to embed a webpacked entity, and have it run through a typescript compiler. But would like something driven from build.rs




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: