Move export for plugin declaration (#555)

Change the expected exported name of plugin declarations to be "plugin"
at the main entrypoint instead of the default export.  This makes the
plugin's code organisation more flexible especially when using CommonJS
JavaScript modules as they can export additional symbols from the
plugin declaration file.
This commit is contained in:
Hornwitser authored and GitHub committed 2024-01-18 20:31:52 +01:00
1 parent 8884116ee9
commit b0f6c95fca
33 files changed
+71 -62

No files matched your search

+1 -1
View File
@@ -52,7 +52,7 @@ async function loadPluginInfos(): Promise<lib.PluginWebpackEnvInfo[]> {
throw new Error(`Plugin did not expose its container via plugin_${meta.name}`);
}
await container.init(__webpack_share_scopes__.default);
let pluginInfo = (await container.get("./info"))().default;
let pluginInfo = (await container.get("./"))().plugin;
pluginInfo.container = container;
pluginInfo.package = (await container.get("./package.json"))();
pluginInfo.enabled = meta.enabled;