export type Info = { /** * Webpack version */ version: string, /** * Bundle hash */ hash: string, /** * Webpack mode (production, development, etc) */ mode: string, /** * Webpack context path */ context: string, /** * Bundle output data by asset type */ assets: AssetsInfo, /** * Bundle input info */ input: InputInfo, /** * Bundle output info */ output: OutputInfo, /** * Error messages */ errors: Message[], /** * Warning messages */ warning: Message[] } export type AssetsInfo = { /** * Initial chunks (entry points) * Need to normalize */ initial: { [key: string]: string[] }, /** * Dynamic imports chunks * Need to normalize */ dynamic: { [key: string]: string[] }, } export type InputInfo = { /** * Entry points */ entries: Entry[], /** * Modules */ modules: Module[], /** * Files */ files: File[], /** * Used node modules */ nodeModules: { [key: string]: string[] } } export type OutputInfo = { /** * Output assets grouped by entry point */ bundles: Bundle[], /** * Bundle chunks */ chunks: Chunk[], /** * Bundle chunk groups */ chunkGroups: ChunkGroup[], /** * Output files */ files: File[] } export type Bundle = { name: string, /** * Entry module id * Need to normalize */ module: string, /** * Chunks id that included by this bundle (entry point) * Need to normalize */ chunks: number[] } export type Chunk = { id: number, name: string, size: number, /** * Groups id that includes this chunk * Need to normalize */ groups: string[], canBeInitial: boolean, onlyInitial: boolean, /** * Id of entry module of this chunk * Need to normalize */ entryModule: string, /** * Output files that generated by this chunk * Need to normalize */ files: string[], /** * Modules id that this chunk includes * Need to normalize */ modules: string[] } export type ChunkGroup = { id: string, isInitial: boolean, name: string, /** * Chunks id that included in this chunk group * Need to normalize */ chunks: string[], /** * Entry chunk id * Need to normalize */ runtimeChunk: number, /** * Children chunks id * Need to normalize */ children: string[], /** * Parent chunks id * Need to normalize */ parents: string[] } export type Entry = { name: string } export type Module = { id: string, /** * File that associates with this module (not always the same as id) */ file: string, size: number, /** * Type of webpack module (Normal, Context, etc) */ type: string, isEntry: boolean, /** * Module id that this module extracted from (e.g. css files in mini-css-extract-plugin) * Need to normalize */ extracted?: string, /** * List of reasons that leads to webpack deoptimization */ deopt: string[], /** * Module dependencies */ deps: Dependency[], /** * Module reasons (the modules, that requires this module) */ reasons: Reason[] } export type File = { path: string ext: string size: number hash: string } export type Reason = { /** * Module id * Need to normalize */ module: string } export type Dependency = { /** * Module id * Need to normalize */ module: string } export type Message = { from: FromEnum, /** * Module or chunk or entrypoint or asset id * Need to normalize */ source?: string | number, type: string, message: string } export enum FromEnum { module = "module", entrypoint = "entrypoint", chunk = "chunk", asset = "asset", unknown = "unknown" }