esbuild-plugin-filesize
Version:
ESBuild plugin for displaying filesize.
24 lines (23 loc) • 950 B
TypeScript
import fileSize from 'filesize';
declare type OptionsInferrer<T> = T extends (bytes: number, options: infer R) => string ? R : void;
export declare type FileSizeFormatOption = OptionsInferrer<typeof fileSize>;
export interface ESBuildPluginFileSizeOption {
showMinifiedSize?: boolean;
showGzippedSize?: boolean;
showBrotliSize?: boolean;
showPluginTitle?: boolean;
format?: FileSizeFormatOption;
theme?: 'light' | 'dark';
}
export interface NormalizedESBuildPluginFileSizeOption extends Required<ESBuildPluginFileSizeOption> {
}
export declare type OutputFileSizeInfo = {
fileSize: string;
fileName: string;
minifiedSize: string;
gzippedSize: string;
brotliSize: string;
outputPath: string;
};
export declare function normalizeOption({ showMinifiedSize, showGzippedSize, showBrotliSize, showPluginTitle, format, theme, }: ESBuildPluginFileSizeOption): NormalizedESBuildPluginFileSizeOption;
export {};