Skip to content

Commit

Permalink
Update lib/compiler/plugins-loader.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Micael Levi L. Cavalcante <mllc@icomp.ufam.edu.br>
  • Loading branch information
kamilmysliwiec and micalevisk committed Dec 27, 2022
1 parent e64480e commit 6b4bf6e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/compiler/plugins-loader.ts
Expand Up @@ -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));
Expand Down

0 comments on commit 6b4bf6e

Please sign in to comment.