Module cache_buster::processor[][src]

Module describing file processor that changes filenames to setup cache-busting

Run the following during build using build.rs:

use cache_buster::BusterBuilder;

fn main() {
    // note: add error checking yourself.
    //    println!("cargo:rustc-env=GIT_process={}", git_process);
    let types = vec![
        mime::IMAGE_PNG,
        mime::IMAGE_SVG,
        mime::IMAGE_JPEG,
        mime::IMAGE_GIF,
    ];

    let config = BusterBuilder::default()
        .source("./dist")
        .result("./prod")
        .mime_types(types)
        .copy(true)
        .follow_links(true)
        .build()
        .unwrap();

    config.process().unwrap();
}

There's a runtime component to this library which will let you read modified filenames from within your program. See [Files]

Structs

Buster

Configuration for setting up cache-busting

BusterBuilder

Builder for Buster.

Enums

BusterBuilderError

Error type for BusterBuilder