How i can add a new dependency to kibana?

I want to add a new module to a project kibana.
I installed kibana from this instruction https://www.elastic.co/guide/en/kibana/current/brew.html
And after i wrote two new plugins for kibana.
This plugins used one big library.
And how i can add this lib into root kibana?
This dependence is cross-cutting and does not affect the kibana

@Ravil I'm not sure if I understood the question correctly, but why not add that big library as dependency of one of the plugins and then as peerDependency of the other one?

If you wanna add that dependency on Kibana itself, I think you'll have to download the Kibana source code, change the package.json of it, build kibana from source and finally use your own built KIbana version.

Cheers

Can you explain how work plugins build? If i add new plugin to kibana i have next structure


I don't see a builded code (i mean a bundle). Does kibana build this plugins?
If so, how is the installation of packages for this, as I understand it, the package is installed inside the plug-in itself, and another plug-in will not be able to see the package, from another plug-in.

Up, it's interesting

Up :slight_smile:

@tiagocosta Hello! Can you help me?

@Ravil How do you distribute your plugins? If your plugins are public, you cannot be sure they always used together. So each of them should declare a dependency on a 3rd party package. To add a dependency go to your plugin and run yarn add package_name, after that run yarn kbn bootstrap to allow Kibana to link own dependencies.

@Mikhail_Shustov, So I wonder if 2 plugins using a common third-party library of the same version, will it be downloaded for each plugin separately or will it be downloaded only once?

Do you mean loaded twice on the client? We use webpack to rebuild a bundle with plugins. I think all dependencies should be deduped and optimized. Just make sure both plugins use the same library version.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.