From 9f18cfbe989d0a8299e0decd99f47e76db2901b8 Mon Sep 17 00:00:00 2001 From: Mohsen Azimi Date: Tue, 25 Oct 2016 07:22:20 -0700 Subject: [PATCH] Add stats to config (#12023) * Add stats to config Reference https://github.com/webpack/extract-text-webpack-plugin/issues/35#issuecomment-176689891 * Update webpack.d.ts --- webpack-dev-server/webpack-dev-server.d.ts | 2 +- webpack/webpack.d.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/webpack-dev-server/webpack-dev-server.d.ts b/webpack-dev-server/webpack-dev-server.d.ts index 9abc2004eb..c58a44ff7f 100644 --- a/webpack-dev-server/webpack-dev-server.d.ts +++ b/webpack-dev-server/webpack-dev-server.d.ts @@ -29,7 +29,7 @@ declare module "webpack-dev-server" { watchOptions?: webpack.WatchOptions; publicPath: string; headers?: any; - stats?: webpack.compiler.StatsToJsonOptions | webpack.compiler.StatsToStringOptions; + stats?: webpack.compiler.StatsOptions| webpack.compiler.StatsToStringOptions; setup?(app: core.Express): void; } diff --git a/webpack/webpack.d.ts b/webpack/webpack.d.ts index 42dbc81e05..b53d44bfb8 100644 --- a/webpack/webpack.d.ts +++ b/webpack/webpack.d.ts @@ -63,6 +63,8 @@ declare module "webpack" { recordsOutputPath?: string; /** Add additional plugins to the compiler. */ plugins?: (Plugin|Function)[]; + /** Stats options for logging */ + stats?: compiler.StatsOptions; } interface Entry { @@ -482,12 +484,12 @@ declare module "webpack" { /** Returns true if there were warnings while compiling. */ hasWarnings(): boolean; /** Return information as json object */ - toJson(options?: StatsToJsonOptions): any; //TODO: type this + toJson(options?: StatsOptions): any; //TODO: type this /** Returns a formatted string of the result. */ toString(options?: StatsToStringOptions): string; } - interface StatsToJsonOptions { + interface StatsOptions { /** context directory for request shortening */ context?: boolean; /** add the hash of the compilation */ @@ -524,7 +526,7 @@ declare module "webpack" { assetsSort?: string; } - interface StatsToStringOptions extends StatsToJsonOptions { + interface StatsToStringOptions extends StatsOptions { /** With console colors */ colors?: boolean; }