mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 08:17:05 +00:00
Merge pull request #33937 from jeremejevs/webpack
webpack: Fix startTime and endTime in Stats
This commit is contained in:
Vendored
+2
-2
@@ -1131,8 +1131,8 @@ declare namespace webpack {
|
||||
abstract class Stats {
|
||||
compilation: compilation.Compilation;
|
||||
hash?: string;
|
||||
startTime?: Date;
|
||||
endTime?: Date;
|
||||
startTime?: number;
|
||||
endTime?: number;
|
||||
/** Returns true if there were errors while compiling. */
|
||||
hasErrors(): boolean;
|
||||
/** Returns true if there were warnings while compiling. */
|
||||
|
||||
@@ -895,3 +895,11 @@ profiling = new webpack.debug.ProfilingPlugin({ outputPath: './path.json' });
|
||||
configuration = {
|
||||
plugins: [profiling]
|
||||
};
|
||||
|
||||
compiler.hooks.done.tap('foo', stats => {
|
||||
if (stats.startTime === undefined || stats.endTime === undefined) {
|
||||
throw new Error('Well, this is odd');
|
||||
}
|
||||
|
||||
console.log(`Compiled in ${stats.endTime - stats.startTime}ms`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user