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


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.


Hi @Joe_Kuan ,

I suggest having a look at our official docs about external plugins creation or this recent community video, 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.

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

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