diff --git a/src/plugins/custom_integrations/public/language_components.tsx b/src/plugins/custom_integrations/public/language_components.tsx new file mode 100644 index 0000000000000..a8dae31b2999a --- /dev/null +++ b/src/plugins/custom_integrations/public/language_components.tsx @@ -0,0 +1,11 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +export { SampleClientReadme } from './components/fleet_integration/sample/sample_client_readme'; +export { ElasticsearchJsClientReadme } from './components/fleet_integration/elasticsearch_js/elasticsearch_js_readme'; +export { ElasticsearchPyClientReadme } from './components/fleet_integration/elasticsearch_py/elasticsearch_py_readme'; diff --git a/src/plugins/custom_integrations/public/plugin.tsx b/src/plugins/custom_integrations/public/plugin.tsx index dbd62d59adcf6..6be4466fdc144 100755 --- a/src/plugins/custom_integrations/public/plugin.tsx +++ b/src/plugins/custom_integrations/public/plugin.tsx @@ -22,10 +22,6 @@ import { import { CustomIntegrationsServicesProvider } from './services'; import { servicesFactory } from './services/kibana'; -import { SampleClientReadme } from './components/fleet_integration/sample/sample_client_readme'; -import { ElasticsearchJsClientReadme } from './components/fleet_integration/elasticsearch_js/elasticsearch_js_readme'; -import { ElasticsearchPyClientReadme } from './components/fleet_integration/elasticsearch_py/elasticsearch_py_readme'; - export class CustomIntegrationsPlugin implements Plugin { @@ -49,9 +45,15 @@ export class CustomIntegrationsPlugin const services = servicesFactory({ coreStart, startPlugins }); const languageClientsUiComponents = { - sample: SampleClientReadme, - javascript: ElasticsearchJsClientReadme, - python: ElasticsearchPyClientReadme, + sample: React.lazy(async () => ({ + default: (await import('./language_components')).SampleClientReadme, + })), + javascript: React.lazy(async () => ({ + default: (await import('./language_components')).ElasticsearchJsClientReadme, + })), + python: React.lazy(async () => ({ + default: (await import('./language_components')).ElasticsearchPyClientReadme, + })), }; const ContextProvider: React.FC = ({ children }) => (