Skip to main content

Manifest

Derive Macro Manifest 

Source
#[derive(Manifest)]
{
    // Attributes available to this derive:
    #[vite_dist]
}
Available on crate feature derive only.
Expand description

Derive macro, that generates Manifest trait implementation from Vite project and .vite/manifest.json.

See examples.

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

ยงOptions

In all string options, you can use env:YOUR_ENV_VAR syntax to reference environment variable.

  • #[vite_dist = "..."] (required)

    Specify path to built Vite project files (aka dist/ folder).

    This folder must contain .vite/manifest.json file. (enabled by build.manifest vite config)

    The value can be:

    • Relative path (to Cargo.toml): examples/vite-project/dist
    • Absolute path: /home/user/Projects/vite-project/dist
    • Environment variable with relative/absolute path: env:YOUR_ENV_VAR