Custom Webpack settings integration with kibana plugin


Am trying to merge my react application with kibana plugin, In my react application I used webpack server and webpack configurations, I used alias to refer my files, I need those configs to be inserted with kibana plugin.

But kibana not accepting my webpack configs. It will be good to get suggestion from you guys to import custom webpack configuration for kibana-plugin

Hey @pradeep_c8

I'd suggest looking into babel plugins that you can use to rewrite babel imports before packaging your plugin in the future, or using a code shift to rewrite your imports to relative paths.

Customizing the webpack aliases Kibana exposes isn't recommended, and could break any time, but for now you can define uiExports.__globalImportAliases__ in your plugin to define aliases that will be merged into the Kibana webpack config.

Good luck!

1 Like

Hi @spalger,

Thanks for your suggestion UIExports.globalImportAliases works fantastic, Now i can able to use alias throughout the project.

One thing is not getting resolved:

I uses scss styles throughout the application in almost every file. Am getting the below error

Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.

On compiling the source. Any idea to get rid of this?

@pradeep_c8 Hmm, well, that sounds a lot like webpack trying load a file type it doesn’t understand.

Are you importing the sass files?

You’ll need to import the css instead.

Can you share additional info or maybe a like to code on Github?