WebpackCompilation.d.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { WebpackChunk } from './WebpackChunk';
  2. import { Source } from 'webpack-sources';
  3. import { ChunkGraph } from './ChunkGraph';
  4. import { WebpackCompiler } from './WebpackCompiler';
  5. import { WebpackStats } from './WebpackStats';
  6. export interface WebpackCompilation {
  7. hash: string;
  8. chunks: IterableIterator<WebpackChunk>;
  9. assets: {
  10. [key: string]: Source;
  11. };
  12. errors: any[];
  13. warnings: any[];
  14. getPath(filename: string, data: {
  15. hash?: any;
  16. chunk?: any;
  17. filename?: string;
  18. basename?: string;
  19. query?: any;
  20. }): string;
  21. hooks: {
  22. optimizeChunkAssets: {
  23. tap: (pluginName: string, handler: (chunks: IterableIterator<WebpackChunk>) => void) => void;
  24. };
  25. processAssets: {
  26. tap: (options: {
  27. name: string;
  28. stage: number;
  29. }, handler: () => void) => void;
  30. };
  31. };
  32. plugin?: (phase: string, callback: Function) => void;
  33. chunkGraph?: ChunkGraph;
  34. compiler: WebpackCompiler;
  35. getStats: () => {
  36. toJson: (options?: WebpackStatsOptions) => WebpackStats;
  37. };
  38. }
  39. export interface WebpackStatsOptions {
  40. all?: boolean;
  41. chunks?: boolean;
  42. chunkModules?: boolean;
  43. nestedModules?: boolean;
  44. dependentModules?: boolean;
  45. cachedModules?: boolean;
  46. }