Crate vite_manifest

Crate vite_manifest 

Source
Expand description

A Rust library for parsing and working with Vite build manifest files.

Vite generates a manifest.json file during build that maps original source files to their corresponding output files, including information about dependencies, CSS files, and chunk relationships.

§Example

use vite_manifest::{parse_manifest, ManifestChunk};

let json = r#"{
    "src/main.js": {
        "file": "assets/main-abc123.js",
        "src": "src/main.js",
        "isEntry": true,
        "css": ["assets/main-def456.css"]
    }
}"#;

let manifest = parse_manifest(json)?;
let main_chunk = manifest.manifest().get("src/main.js").unwrap();
println!("Output file: {}", main_chunk.file);

Structs§

Manifest
ManifestChunk

Functions§

manifest_to_json
Serialize manifest to JSON string
parse_manifest
Deserialize manifest from JSON string