#loader #directory #ui

yanked sika-asset-loader

A static resource loader

1 unstable release

0.1.0 Aug 11, 2023

#146 in #loader

MIT license

8KB
168 lines

Cargo.toml
[build-dependencies]
sika-asset-loader = "0.1.0"
build.rs
fn main() {
    let loader = sika_asset_loader::AssetLoader::new()
        .dir("ui")
        .output("ui.rs");
    if let Err(err) = loader.load() {
        println!("cargo:warning={:?}", err);
    }
}

Use
mod ui {
    include!(concat!(env!("OUT_DIR"), "/ui.rs"));
}

let scope = web::scope("/ui");
ui::asset_handle(scope);

Dependencies

~3MB
~41K SLoC