diff --git a/packages/autodetect/src/index.ts b/packages/autodetect/src/index.ts index 4cc4c191f3..11b77fb780 100644 --- a/packages/autodetect/src/index.ts +++ b/packages/autodetect/src/index.ts @@ -14,9 +14,16 @@ * limitations under the License. */ +type Modules = Array<{ + name: string; + module: object; // Loaded Webpack Module of Backstage Plugin +}>; + function getAvailablePlugins() { - return __webpack_require__( + const { modules }: { modules: Modules } = __webpack_require__( './node_modules/backstage-autodetected-plugins.js', ); + return modules; } + export { getAvailablePlugins }; diff --git a/plugins/devtools/src/components/Content/InfoContent/InfoContent.tsx b/plugins/devtools/src/components/Content/InfoContent/InfoContent.tsx index b40d2ce1df..c55b57b4b8 100644 --- a/plugins/devtools/src/components/Content/InfoContent/InfoContent.tsx +++ b/plugins/devtools/src/components/Content/InfoContent/InfoContent.tsx @@ -79,7 +79,7 @@ export const InfoContent = () => { const { about, loading, error } = useInfo(); const plugins = autodetect.getAvailablePlugins(); const availablePlugins: PackageDependency[] = ( - plugins.modules as Array> + plugins as Array> ).map(({ name, module }) => { const pluginImpl: any = Object.values(module).find((v: any) => !!v?.getId);