@codechecks/build-size-watcher
Version:
Keep your build size in check and detect when it gets too big
40 lines (39 loc) • 1.03 kB
TypeScript
import { Dictionary } from "ts-essentials";
export interface FileDescription {
path: string;
maxSize?: number | string;
}
export interface BuildSizeWatcherOptions {
gzip?: boolean;
files: FileDescription[];
name?: string;
}
export interface NormalizedFileDescription {
path: string;
maxSize?: number;
}
export interface NormalizedBuildSizeOptions {
gzip: boolean;
files: NormalizedFileDescription[];
name: string;
artifactName: string;
}
export interface FileArtifact {
path: string;
files: number;
overallSize: number;
}
export declare type FullArtifact = Dictionary<FileArtifact>;
export declare type ArtifactDiffType = "changed" | "new" | "deleted";
export declare type ArtifactDiff = {
type: ArtifactDiffType;
overallSize: number;
sizeChange: number;
sizeChangeFraction: number;
};
export declare type FullArtifactDiff = {
totalSize: number;
totalSizeChange: number;
totalSizeChangeFraction: number;
files: Dictionary<ArtifactDiff>;
};