vite-static 0.4.0

Embed Vite chunks into your Rust application and query them individually.
Documentation
use actix_web::{
    App, HttpServer,
    http::header::{CacheControl, CacheDirective},
};
use vite_static::{ActixFiles, Manifest};

#[derive(Manifest)]
#[vite_dist = "examples/vite-project/dist"]
struct MyViteStatic;

#[actix_web::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(|| {
        App::new()
            // serve static:
            .service(
                // Path and Box<dyn Manifest> of your static
                ActixFiles::new("/", MyViteStatic.boxed())
                    // set your own cache control: (by default none)
                    .cache_control(CacheControl(vec![CacheDirective::MaxAge(3600 * 6)])),
            )
    })
    .bind(("127.0.0.1", 8080))?
    .run()
    .await

    // And go to `http://localhost:8080/entry1.<see hash in dist folder>.js`
}