Function embed_js_build::preprocess_crate [] [src]

pub fn preprocess_crate(lib_root: &Path)

Call this once from a build script for a crate that uses embed_js directly.

Parameters:

  • lib_root The path to the crate root rust file, e.g. "src/lib.rs"

Example:

Be careful when using this code, it's not being tested!
extern crate embed_js_build;
fn main() {
    use std::path::PathBuf;
    let root = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap()).join("src/lib.rs");
    embed_js_build::preprocess_crate(&root);
}