core-api: add lazy loading of component extensions

Co-authored-by: Fredrik Adelöw <freben@gmail.com>
Co-authored-by: blam <ben@blam.sh>
This commit is contained in:
Patrik Oldsberg
2020-12-17 17:20:24 +01:00
parent adb1afdc2b
commit c35554dc4c
7 changed files with 136 additions and 64 deletions
+1 -2
View File
@@ -19,7 +19,6 @@ import {
createApiFactory,
createRoutableExtension,
} from '@backstage/core';
import { GraphiQLPage as Component } from './components';
import { graphQlBrowseApiRef, GraphQLEndpoints } from './lib/api';
import { graphiQLRouteRef } from './route-refs';
@@ -42,7 +41,7 @@ export const plugin = createPlugin({
export const GraphiQLPage = plugin.provide(
createRoutableExtension({
component: Component,
component: () => import('./components').then(m => m.GraphiQLPage),
mountPoint: graphiQLRouteRef,
}),
);