1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
use serde::Deserialize;
use std::borrow::Cow;
use std::collections::HashMap;
use crate::common::ChunkName;
use asset::Asset;
use crate::v5::module::Module;
use crate::DurationMillis;
use chunk::Chunk;
use emit::AssetPath;
pub mod asset;
pub mod chunk;
pub mod emit;
pub mod entry_point;
pub mod module;
pub mod reason;
pub mod source;
#[derive(Deserialize, Debug, Default)]
#[serde(rename_all = "camelCase", default)]
pub struct Stats<'a> {
pub version: Cow<'a, str>,
pub hash: Cow<'a, str>,
pub time: DurationMillis,
pub public_path: Cow<'a, str>,
pub output_path: Cow<'a, str>,
#[serde(borrow)]
pub assets_by_chunk_name: ChunkMapping<'a>,
pub assets: Vec<Asset<'a>>,
pub chunks: Vec<Chunk<'a>>,
pub modules: Vec<Module<'a>>,
#[serde(skip)]
errors: Vec<()>,
errors_count: usize,
#[serde(skip)]
warnings: Vec<()>,
warnings_count: usize,
children: Vec<Self>,
}
type ChunkMapping<'a> = HashMap<ChunkName<'a>, Vec<AssetPath<'a>>>;
#[cfg(test)]
mod tests;