Bind dynamic plugins to existing routes
You can bind to existing plugins and their routes, and declare new targets sourced from dynamic plugins as shown in the following routeBindings configuration:
# dynamic-plugins-config.yaml
plugins:
- plugin: <plugin_path_or_url>
disabled: false
pluginConfig:
dynamicPlugins:
frontend:
my-plugin:
routeBindings:
targets:
- name: <plugin_name>Plugin
importName: <plugin_key>Plugin
module: CustomModule
bindings:
- bindTarget: "<plugin_name>Plugin.externalRoutes"
bindMap:
headerLink: "<plugin_name>Plugin.routes.root"
where:
-
my-plugin - The plugin package name.
-
targets - A new bind target.
-
name - Optional: Defaults to
importName. Explicit name of the plugin that exposes the bind target. -
importName - Required: Explicit import name that references a
BackstagePlugin<{}>implementation. -
module - Optional: Same as the key in
scalprum.exposedModulesin thepackage.jsonfile of the plugin. -
bindTarget - Required: One of the supported or imported bind targets.
-
bindMap - Required: A map of route bindings similar to
bindfunction options.
To configure routeBindings, complete the following steps:
- Define new targets using
routeBindings.targets. Set the requiredimportNameto aBackstagePlugin<{}>implementation. - Declare route bindings using the
routeBindings.bindingsfield by settingbindTargetto the name of the target to bind to. This is a dynamic or static target, such as:catalogPlugin.externalRoutescatalogImportPlugin.externalRoutestechdocsPlugin.externalRoutesscaffolderPlugin.externalRoutesYou can extend existing pages with additional content by using mount points. The application defines these identifiers throughout the system.