Skip to content

Commit

Permalink
Update: measure plugin loading time and output in debug message (#12395)
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-homyakov authored and platinumazure committed Oct 25, 2019
1 parent 1744fab commit 364877b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/cli-engine/config-array-factory.js
Expand Up @@ -859,8 +859,14 @@ class ConfigArrayFactory {
if (filePath) {
try {
writeDebugLogForLoading(request, relativeTo, filePath);

const startTime = Date.now();
const pluginDefinition = require(filePath);

debug(`Plugin ${filePath} loaded in: ${Date.now() - startTime}ms`);

return new ConfigDependency({
definition: normalizePlugin(require(filePath)),
definition: normalizePlugin(pluginDefinition),
filePath,
id,
importerName,
Expand Down

0 comments on commit 364877b

Please sign in to comment.