HeadlessPluginInitialiser install plugin
Summary: Allow adding plugins after initialisation. Effectively: - Load the plugin creates the SandyPluginDefinition - Add the definition to the existing loaded plugins Reviewed By: passy Differential Revision: D37749811 fbshipit-source-id: ea834b9e6105cf605fc906a794022f61807ce1d8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
b9e1039b7a
commit
1778ce4f46
@@ -49,4 +49,15 @@ export class HeadlessPluginInitializer extends AbstractPluginInitializer {
|
||||
.filter(isSandyPlugin)
|
||||
.filter((plugin) => plugin.headless);
|
||||
}
|
||||
|
||||
async installPlugin(
|
||||
plugin: InstalledPluginDetails,
|
||||
): Promise<_SandyPluginDefinition | undefined> {
|
||||
const loaded = await this.loadPlugins([plugin]);
|
||||
this._initialPlugins.push(...loaded);
|
||||
|
||||
if (loaded.length > 0) {
|
||||
return loaded.at(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user