* Configures an external, 3rd party plugin before Aurelia starts. * @param plugin The ID of the 3rd party plugin to configure. * @param pluginConfig The configuration for the specified plugin. * @return Returns the current FrameworkConfiguration instance.
(
plugin: string | ((frameworkConfig: FrameworkConfiguration) => any) | FrameworkPluginInfo,
pluginConfig?: any
)
| 366 | * @return Returns the current FrameworkConfiguration instance. |
| 367 | */ |
| 368 | plugin( |
| 369 | plugin: string | ((frameworkConfig: FrameworkConfiguration) => any) | FrameworkPluginInfo, |
| 370 | pluginConfig?: any |
| 371 | ): FrameworkConfiguration { |
| 372 | assertProcessed(this); |
| 373 | |
| 374 | let info: FrameworkPluginInfo; |
| 375 | switch (typeof plugin) { |
| 376 | case 'string': |
| 377 | info = { moduleId: plugin, resourcesRelativeTo: [plugin, ''], config: pluginConfig || {} }; |
| 378 | break; |
| 379 | case 'function': |
| 380 | info = { configure: plugin, config: pluginConfig || {} }; |
| 381 | break; |
| 382 | default: |
| 383 | throw new Error(invalidConfigMsg(plugin, 'plugin')); |
| 384 | } |
| 385 | this.info.push(info); |
| 386 | return this; |
| 387 | } |
| 388 | |
| 389 | /** @internal */ |
| 390 | _addNormalizedPlugin(name, config?) { |