1 | import { Plugin, OutputOptions } from "rollup";
|
2 | import { partial } from "filesize";
|
3 |
|
4 | export interface FileSizeInfo {
|
5 | minSize: string;
|
6 | gzipSize: string;
|
7 | brotliSize: string;
|
8 | bundleSize: string;
|
9 | fileName: string;
|
10 | lastVersion?: string;
|
11 | bundleSizeBefore?: string;
|
12 | brotliSizeBefore?: string;
|
13 | minSizeBefore?: string;
|
14 | gzipSizeBefore?: string;
|
15 | }
|
16 |
|
17 | export type FileSizeRender<T> = (
|
18 | options: FileSizeOptions,
|
19 | outputOptions: OutputOptions,
|
20 | info: FileSizeInfo
|
21 | ) => T;
|
22 |
|
23 | export interface FileSizeOptions {
|
24 | showMinifiedSize?: boolean;
|
25 | showGzippedSize?: boolean;
|
26 | showBrotliSize?: boolean;
|
27 | showBeforeSizes?: "release" | "build" | "none";
|
28 | format?: Parameters<typeof partial>[0];
|
29 | render?: FileSizeRender<string>;
|
30 | theme?: "dark" | "light";
|
31 | }
|
32 |
|
33 | export type FileSizeReporter =
|
34 | | "boxen"
|
35 | | FileSizeRender<string | Promise<string>>;
|
36 |
|
37 | export interface FileSizePluginOptions extends FileSizeOptions {
|
38 | reporter?: FileSizeReporter | FileSizeReporter[];
|
39 | }
|
40 |
|
41 | declare const filesize: (options?: FileSizePluginOptions) => Plugin;
|
42 |
|
43 | export default filesize;
|