guess-webpack
Version:
Webpack plugins for the Machine Learning-driven bundler
42 lines (41 loc) • 1.2 kB
TypeScript
import { PrefetchConfig, BundleEntryGraph, FileChunkMap } from './declarations';
import { Graph, RoutingModule } from '../../common/interfaces';
import { Logger } from '../../common/logger';
export declare const defaultPrefetchConfig: PrefetchConfig;
export declare const buildMap: (routes: RoutingModule[], graph: Graph, logger: Logger, debug: boolean) => BundleEntryGraph;
export declare const stripExtension: (path: string) => string;
export interface Compilation {
getStats(): {
toJson(): JSCompilation;
};
}
export interface JSReason {
module: string;
moduleId: string;
}
export interface JSModule {
id: string;
name: string;
reasons: JSReason[];
chunks: number[];
}
export interface JSOrigin {
name: string;
moduleName: string;
module: string;
}
export interface JSChunk {
id: number;
files: string[];
initial: boolean;
modules: JSModule[];
origins: JSOrigin[];
}
export interface JSCompilation {
chunks: JSChunk[];
modules: JSModule[];
}
export declare const getCompilationMapping: (compilation: Compilation, entryPoints: Set<string>, logger: Logger) => {
mainName: string | null;
fileChunk: FileChunkMap;
};