3 ms·
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 artifac
by cmrdporcupine 2y ago
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.
- pshu 2y agowhat about this https://crates.io/crates/rust-embed https://crates.io/crates/rust-embed
- cmrdporcupine 2y agoWell 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
- brabel 2y agoI 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.
- cmrdporcupine 2y agoFound 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.