Closed RolandJansen closed 4 years ago
This is tricky (at this point of development).
So this is something that should be done right after the release of 0.5.
There are two new API function
addPluginClass(PluginClass: IPluginConstructor): void
removePluginClass(className: string): boolean
Plugins are simply ES2015 modules that can be dynamically loaded into the browser like this:
import * as intermix from "<path-to-file>"; // just to clarify where the "intermix" object comes from
[...]
import("<url>").then((PluginModule) => {
intermix.addPluginClass(PluginModule.default);
}
or even simpler
const PluginModule = await import("<url>");
intermix.addPluginClass(PluginModule.default);
see d592c1cde990d7591a4ca9168a1c10fb8995dbe5
Followup to #116