From 6b4bf6e2e0acb0aed2dbcc70095d96743bb3ee44 Mon Sep 17 00:00:00 2001 From: Kamil Mysliwiec Date: Tue, 27 Dec 2022 11:36:37 +0100 Subject: [PATCH] Update lib/compiler/plugins-loader.ts Co-authored-by: Micael Levi L. Cavalcante --- lib/compiler/plugins-loader.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/compiler/plugins-loader.ts b/lib/compiler/plugins-loader.ts index 1dca86795..1e5de8eb0 100644 --- a/lib/compiler/plugins-loader.ts +++ b/lib/compiler/plugins-loader.ts @@ -62,10 +62,7 @@ export class PluginsLoader { if (!plugin.before && !plugin.after && !plugin.afterDeclarations) { throw new Error(CLI_ERRORS.WRONG_PLUGIN(pluginNames[index])); } - const options = - plugins[index] !== null && typeof plugins[index] === 'object' - ? (plugins[index] as PluginAndOptions).options || {} - : {}; + const options = plugins[index]?.options || {}; plugin.before && beforeHooks.push(plugin.before.bind(plugin.before, options)); plugin.after && afterHooks.push(plugin.after.bind(plugin.after, options));