# How i can add a new dependency to kibana?

**URL:** <https://discuss.elastic.co/t/how-i-can-add-a-new-dependency-to-kibana/202694>\
**Category:** Kibana\
**Created:** [October 8, 2019, 2:54pm UTC](https://discuss.elastic.co/t/how-i-can-add-a-new-dependency-to-kibana/202694 "2019-10-08T14:54:18Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ravil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravil/32/55546_2.png) [@Ravil](https://discuss.elastic.co/u/Ravil)\
**Post date:** [October 8, 2019, 2:54pm UTC](https://discuss.elastic.co/t/how-i-can-add-a-new-dependency-to-kibana/202694/1 "2019-10-08T14:54:19Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![tiagocosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tiagocosta/32/40045_2.png) [@tiagocosta](https://discuss.elastic.co/u/tiagocosta)\
**Post date:** [October 8, 2019, 4:07pm UTC](https://discuss.elastic.co/t/how-i-can-add-a-new-dependency-to-kibana/202694/2 "2019-10-08T16:07:13Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![Ravil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravil/32/55546_2.png) [@Ravil](https://discuss.elastic.co/u/Ravil)\
**Post date:** [October 9, 2019, 6:52am UTC](https://discuss.elastic.co/t/how-i-can-add-a-new-dependency-to-kibana/202694/3 "2019-10-09T06:52:52Z")

</div>

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

 ![28](https://us1.discourse-cdn.com/elastic/original/3X/1/2/128d5b5693e6e516f2ed0c46990c9167b25757ce.png)  
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.

---

<div class="post-metadata">

**Author:** ![Ravil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravil/32/55546_2.png) [@Ravil](https://discuss.elastic.co/u/Ravil)\
**Post date:** [October 10, 2019, 6:23am UTC](https://discuss.elastic.co/t/how-i-can-add-a-new-dependency-to-kibana/202694/4 "2019-10-10T06:23:52Z")

</div>

Up, it's interesting

---

<div class="post-metadata">

**Author:** ![Ravil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravil/32/55546_2.png) [@Ravil](https://discuss.elastic.co/u/Ravil)\
**Post date:** [October 11, 2019, 8:57am UTC](https://discuss.elastic.co/t/how-i-can-add-a-new-dependency-to-kibana/202694/5 "2019-10-11T08:57:33Z")

</div>

Up 🙂

---

<div class="post-metadata">

**Author:** ![Ravil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravil/32/55546_2.png) [@Ravil](https://discuss.elastic.co/u/Ravil)\
**Post date:** [October 14, 2019, 7:40am UTC](https://discuss.elastic.co/t/how-i-can-add-a-new-dependency-to-kibana/202694/6 "2019-10-14T07:40:34Z")

</div>

@tiagocosta Hello! Can you help me?

---

<div class="post-metadata">

**Author:** ![Mikhail\_Shustov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikhail_shustov/32/49186_2.png) [@Mikhail\_Shustov](https://discuss.elastic.co/u/Mikhail_Shustov)\
**Post date:** [October 15, 2019, 3:11pm UTC](https://discuss.elastic.co/t/how-i-can-add-a-new-dependency-to-kibana/202694/7 "2019-10-15T15:11:50Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Ravil](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ravil/32/55546_2.png) [@Ravil](https://discuss.elastic.co/u/Ravil)\
**Post date:** [October 16, 2019, 7:32am UTC](https://discuss.elastic.co/t/how-i-can-add-a-new-dependency-to-kibana/202694/8 "2019-10-16T07:32:39Z")

</div>

> [@Mikhail\_Shustov](#):
>
> So **each** of them should declare a dependency on a 3rd party package

@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?

---

<div class="post-metadata">

**Author:** ![Mikhail\_Shustov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mikhail_shustov/32/49186_2.png) [@Mikhail\_Shustov](https://discuss.elastic.co/u/Mikhail_Shustov)\
**Post date:** [October 18, 2019, 4:52pm UTC](https://discuss.elastic.co/t/how-i-can-add-a-new-dependency-to-kibana/202694/9 "2019-10-18T16:52:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 15, 2019, 4:52pm UTC](https://discuss.elastic.co/t/how-i-can-add-a-new-dependency-to-kibana/202694/10 "2019-11-15T16:52:47Z")

</div>

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