From 364877b2504e8f7ece04770b93d517e2f27458d0 Mon Sep 17 00:00:00 2001 From: Victor Homyakov Date: Fri, 25 Oct 2019 21:08:43 +0300 Subject: [PATCH] Update: measure plugin loading time and output in debug message (#12395) --- lib/cli-engine/config-array-factory.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/cli-engine/config-array-factory.js b/lib/cli-engine/config-array-factory.js index 6e1ba1e02b9..cf529b6ee63 100644 --- a/lib/cli-engine/config-array-factory.js +++ b/lib/cli-engine/config-array-factory.js @@ -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,