sika-asset-loader

Crates.iosika-asset-loader
lib.rssika-asset-loader
version0.1.0
sourcesrc
created_at2023-08-11 20:16:37.884247
updated_at2023-08-11 20:16:37.884247
descriptionA static resource loader.
homepagehttps://github.com/sika-rs
repositoryhttps://github.com/sika-rs/sika-asset-loader
max_upload_size
id942221
size8,904
(QAQtutu)

documentation

README

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);
Commit count: 0

cargo fmt