diff --git a/packages/mjml-core/src/components.js b/packages/mjml-core/src/components.js index 556d10927..a2a33f2b1 100644 --- a/packages/mjml-core/src/components.js +++ b/packages/mjml-core/src/components.js @@ -1,4 +1,5 @@ import { kebabCase } from 'lodash' +import { registerDependencies } from 'mjml-validator' const components = {} @@ -8,8 +9,12 @@ export function assignComponents(target, source) { } } -export function registerComponent(Component) { +export function registerComponent(Component, options = {}) { assignComponents(components, [Component]) + + if (Component.dependencies && options.registerDependencies) { + registerDependencies(Component.dependencies) + } } export default components