# How to include external css and js files into kibana plugin?

**URL:** <https://discuss.elastic.co/t/how-to-include-external-css-and-js-files-into-kibana-plugin/322378>\
**Category:** Kibana\
**Tags:** kibana-plugin-development\
**Created:** [January 3, 2023, 2:01pm UTC](https://discuss.elastic.co/t/how-to-include-external-css-and-js-files-into-kibana-plugin/322378 "2023-01-03T14:01:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe\_Kuan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joe_kuan/32/101700_2.png) [@Joe\_Kuan](https://discuss.elastic.co/u/Joe_Kuan)\
**Post date:** [January 3, 2023, 2:01pm UTC](https://discuss.elastic.co/t/how-to-include-external-css-and-js-files-into-kibana-plugin/322378/1 "2023-01-03T14:01:34Z")

</div>

Hi

I need to include some css and js files into my kibana plugin. I have tried adding the "files" option (explicit path without using wildcards) to package.json and run "yarn build ...". However, I can't see any file size change in the output "build" directory.

I have also tried adding the files to "include" config in tsconfig.json and still no luck.

Any advise is much appreciated.

Thanks  
Joe

---

<div class="post-metadata">

**Author:** ![Dzmitry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dzmitry/32/65026_2.png) [@Dzmitry](https://discuss.elastic.co/u/Dzmitry)\
**Post date:** [January 4, 2023, 4:32pm UTC](https://discuss.elastic.co/t/how-to-include-external-css-and-js-files-into-kibana-plugin/322378/2 "2023-01-04T16:32:07Z")

</div>

Hi @Joe_Kuan ,

I suggest having a look at our official [docs](https://www.elastic.co/guide/en/kibana/current/plugin-tooling.html) about external plugins creation or this recent community [video](https://www.youtube.com/watch?v=kzLmswbFQho), that is a live demo of adding a new plugin.

You can check canvas plugin, it has custom styles. But it is quite complex plugin and things might not work easily.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/e/fec464e64502c3744b1a81b1bbc0ea51074ed1f1.png)

As for extra dependency, you can install as many packages from npm as you like. But probably they should be included in your plugin's archive because Kibana doesn't install them when your plugin is installed. At least it was a case few years back.

Regards, Dima

---

<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:** [February 1, 2023, 4:32pm UTC](https://discuss.elastic.co/t/how-to-include-external-css-and-js-files-into-kibana-plugin/322378/3 "2023-02-01T16:32:45Z")

</div>

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