mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-30 10:35:22 +08:00
Add typing for webpack profiling plugin
This commit is contained in:
21
types/webpack/index.d.ts
vendored
21
types/webpack/index.d.ts
vendored
@@ -648,6 +648,27 @@ declare namespace webpack {
|
||||
portableRecords?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
namespace debug {
|
||||
interface ProfilingPluginOptions {
|
||||
/** A relative path to a custom output file (json) */
|
||||
outputPath?: string;
|
||||
}
|
||||
/**
|
||||
* Generate Chrome profile file which includes timings of plugins execution. Outputs `events.json` file by
|
||||
* default. It is possible to provide custom file path using `outputPath` option.
|
||||
*
|
||||
* In order to view the profile file:
|
||||
* * Run webpack with ProfilingPlugin.
|
||||
* * Go to Chrome, open the Profile Tab.
|
||||
* * Drag and drop generated file (events.json by default) into the profiler.
|
||||
*
|
||||
* It will then display timeline stats and calls per plugin!
|
||||
*/
|
||||
class ProfilingPlugin extends Plugin {
|
||||
constructor(options?: ProfilingPluginOptions);
|
||||
}
|
||||
}
|
||||
namespace compilation {
|
||||
class Asset {
|
||||
}
|
||||
|
||||
@@ -732,3 +732,10 @@ configuration = {
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
let profiling = new webpack.debug.ProfilingPlugin();
|
||||
profiling = new webpack.debug.ProfilingPlugin({ outputPath: './path.json' });
|
||||
|
||||
configuration = {
|
||||
plugins: [profiling]
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user